[Libreoffice-commits] core.git: sal/systools
Michael Stahl
mstahl at redhat.com
Thu Sep 3 03:52:39 PDT 2015
sal/systools/win32/uwinapi/legacy.c | 4 ++++
sal/systools/win32/uwinapi/sntprintf.c | 6 ++----
2 files changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 20348de1d5ce4ded0b6c71fcc927ec4e007d61e7
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Sep 3 11:19:23 2015 +0200
sal: actually export the legacy function for VS 2015
Change-Id: I29e43f865133b030bbe76d5a9fe90c978228ed96
Reviewed-on: https://gerrit.libreoffice.org/18294
Reviewed-by: David Ostrovsky <david at ostrovsky.org>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sal/systools/win32/uwinapi/legacy.c b/sal/systools/win32/uwinapi/legacy.c
index b789c07..9ba73b2 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 cbebed5..0b7db36 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
More information about the Libreoffice-commits
mailing list