Skip to content

Commit 2d42114

Browse files
authored
Merge pull request #620 from zeux/nostl-warnfix
Work around 'unreferenced function' warnings in NO_STL builds
2 parents ac0ef85 + c691c6b commit 2d42114

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pugixml.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5054,6 +5054,14 @@ PUGI_IMPL_NS_BEGIN
50545054
#if defined(PUGI_IMPL_MSVC_CRT_VERSION) || defined(__BORLANDC__) || (defined(__MINGW32__) && (!defined(__STRICT_ANSI__) || defined(__MINGW64_VERSION_MAJOR)))
50555055
PUGI_IMPL_FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode)
50565056
{
5057+
#ifdef PUGIXML_NO_STL
5058+
// ensure these symbols are consistently referenced to avoid 'unreferenced function' warnings
5059+
// note that generally these functions are used in STL builds, but PUGIXML_NO_STL leaves the only usage in convert_path_heap
5060+
(void)&as_utf8_begin;
5061+
(void)&as_utf8_end;
5062+
(void)&strlength_wide;
5063+
#endif
5064+
50575065
#if defined(PUGI_IMPL_MSVC_CRT_VERSION) && PUGI_IMPL_MSVC_CRT_VERSION >= 1400
50585066
FILE* file = NULL;
50595067
return _wfopen_s(&file, path, mode) == 0 ? file : NULL;

0 commit comments

Comments
 (0)