summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sal/systools/win32/uwinapi/legacy.c4
-rw-r--r--sal/systools/win32/uwinapi/sntprintf.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/sal/systools/win32/uwinapi/legacy.c b/sal/systools/win32/uwinapi/legacy.c
index b789c07bbb8d..9ba73b27f6c8 100644
--- a/sal/systools/win32/uwinapi/legacy.c
+++ b/sal/systools/win32/uwinapi/legacy.c
@@ -14,6 +14,10 @@
#pragma warning(disable:4273) // inconsistent dll linkage
#endif
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+// older versions use uwinapi.def file for export
+SAL_DLLPUBLIC_EXPORT
+#endif
DWORD WINAPI GetShortPathNameW(LPCWSTR lpszLongPath,LPWSTR lpszShortPath,DWORD cchBuffer)
{
typedef DWORD (WINAPI * GetShortPathNameW_t) (LPCWSTR,LPWSTR,DWORD);
diff --git a/sal/systools/win32/uwinapi/sntprintf.c b/sal/systools/win32/uwinapi/sntprintf.c
index cbebed5e7ee6..0b7db36a23c5 100644
--- a/sal/systools/win32/uwinapi/sntprintf.c
+++ b/sal/systools/win32/uwinapi/sntprintf.c
@@ -58,7 +58,8 @@ static int __cdecl _vsctprintf( const _TXCHAR *format, va_list ap )
}
#endif
-#if !defined(__MINGW32__) || defined (__NO_ISOCEXT)
+/* VS 2015 and above support ISO C snprintf */
+#if (defined(__MINGW32__) && !defined (__NO_ISOCEXT)) || (defined(_MSC_VER) && (_MSC_VER < 1900))
/* This function retrieves the pointer to the last character of a buffer.
That is the pointer to the last character of the buffer that fits
@@ -90,8 +91,6 @@ static _TCHAR *GetLastBufferChar( _TCHAR *buffer, size_t count )
return last;
}
-/* VS 2015 and above support ISO C snprintf */
-#if _MSC_VER < 1900
/* Implementation of snprintf following the ISO/IEC 9899:1999 (ISO C99) standard */
@@ -144,7 +143,6 @@ _SNPRINTF_DLLIMPORT int __cdecl sntprintf( _TCHAR *buffer, size_t count, const _
return retval;
}
-#endif
#endif