summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2015-07-02 08:06:07 +0200
committerMichael Stahl <mstahl@redhat.com>2015-09-02 20:40:21 +0000
commit0c9ddb24ee0388d03c313caf5a45f1aa26049781 (patch)
treee91e799f21aa940e80bf8f59733ec6f7e6efc37b /sal
parented7d22049596ac91ad75bfad1a5675c13714e203 (diff)
Don't redefine snprintf as VS 2015 supports ISO standard
Make the workaround in snprintf.h conditional on older MSVC version. Investigation reveals that the GetShortPathNameW is presumably used by legacy Duden extension that was built by Sun in a setsolar environment. The uwinapi.lib was never part of the SDK, so ordinary extensions cannot link against it. The PRIVATE export of the symbol that is only possible with DEF file therefore does not matter much. With VC2015 there is no need for LO code to use uwinapi.dll at all and gb_UWINAPI can be unset in this case. Change-Id: I23a5636db9431b0fa4350b665a6a69613d625264 Reviewed-on: https://gerrit.libreoffice.org/16677 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/Library_uwinapi.mk3
-rw-r--r--sal/systools/win32/uwinapi/sntprintf.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/sal/Library_uwinapi.mk b/sal/Library_uwinapi.mk
index 089ab59ee825..ed4efde10b6c 100644
--- a/sal/Library_uwinapi.mk
+++ b/sal/Library_uwinapi.mk
@@ -33,14 +33,15 @@ $(eval $(call gb_Library_add_cobjects,uwinapi,\
ifeq ($(COM),MSC)
-
$(eval $(call gb_Library_add_cobjects,uwinapi,\
sal/systools/win32/uwinapi/legacy \
))
+ifeq ($(VCVER),120)
$(eval $(call gb_Library_add_ldflags,uwinapi,\
/DEF:$(SRCDIR)/sal/systools/win32/uwinapi/uwinapi.def \
))
+endif
endif
diff --git a/sal/systools/win32/uwinapi/sntprintf.c b/sal/systools/win32/uwinapi/sntprintf.c
index 70980305c4ae..cbebed5e7ee6 100644
--- a/sal/systools/win32/uwinapi/sntprintf.c
+++ b/sal/systools/win32/uwinapi/sntprintf.c
@@ -90,6 +90,9 @@ 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 */
_SNPRINTF_DLLIMPORT int __cdecl vsntprintf( _TCHAR *buffer, size_t count, const _TCHAR *format, va_list list )
@@ -141,6 +144,7 @@ _SNPRINTF_DLLIMPORT int __cdecl sntprintf( _TCHAR *buffer, size_t count, const _
return retval;
}
+#endif
#endif