[Libreoffice-commits] core.git: 12 commits - canvas/Library_cairocanvas.mk configure.ac connectivity/CppunitTest_connectivity_ado.mk connectivity/CppunitTest_connectivity_commontools.mk connectivity/Library_ado.mk desktop/Library_deploymentgui.mk embeddedobj/Library_emboleobj.mk embedserv/Library_emser.mk extensions/Library_oleautobridge.mk external/boost fpicker/source sal/osl sd/source setup_native/Library_sellangmsi.mk setup_native/Library_shlxtmsi.mk shell/Library_ooofilt.mk shell/Library_ooofilt_x64.mk shell/Library_propertyhdl.mk shell/Library_propertyhdl_x64.mk shell/Library_shlxthdl.mk shell/Library_shlxthdl_x64.mk shell/source shell/StaticLibrary_shlxthandler_common.mk shell/StaticLibrary_shlxthandler_common_x64.mk solenv/gbuild vcl/source vcl/win

Michael Stahl mstahl at redhat.com
Thu Mar 5 06:46:17 PST 2015


 canvas/Library_cairocanvas.mk                         |    4 
 configure.ac                                          |   12 --
 connectivity/CppunitTest_connectivity_ado.mk          |    6 -
 connectivity/CppunitTest_connectivity_commontools.mk  |    6 -
 connectivity/Library_ado.mk                           |   12 --
 desktop/Library_deploymentgui.mk                      |    4 
 embeddedobj/Library_emboleobj.mk                      |    4 
 embedserv/Library_emser.mk                            |    1 
 extensions/Library_oleautobridge.mk                   |    4 
 external/boost/StaticLibrary_boostthread.mk           |    4 
 fpicker/source/win32/filepicker/FileOpenDlg.hxx       |    4 
 sal/osl/w32/socket.cxx                                |   74 ++++++++++++++++--
 sd/source/ui/remotecontrol/BluetoothServer.cxx        |    8 -
 sd/source/ui/remotecontrol/DiscoveryService.cxx       |    2 
 setup_native/Library_sellangmsi.mk                    |    1 
 setup_native/Library_shlxtmsi.mk                      |    1 
 shell/Library_ooofilt.mk                              |    2 
 shell/Library_ooofilt_x64.mk                          |    2 
 shell/Library_propertyhdl.mk                          |    2 
 shell/Library_propertyhdl_x64.mk                      |    2 
 shell/Library_shlxthdl.mk                             |    2 
 shell/Library_shlxthdl_x64.mk                         |    2 
 shell/StaticLibrary_shlxthandler_common.mk            |    2 
 shell/StaticLibrary_shlxthandler_common_x64.mk        |    2 
 shell/source/win32/shlxthandler/infotips/infotips.cxx |    2 
 solenv/gbuild/platform/com_MSC_defs.mk                |   16 +--
 solenv/gbuild/platform/windows.mk                     |    7 +
 vcl/source/gdi/pdfwriter_impl.cxx                     |    4 
 vcl/win/source/app/salinst.cxx                        |    5 +
 29 files changed, 99 insertions(+), 98 deletions(-)

New commits:
commit 743a4bf7f86d957412944fefbe694fe429f82463
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 20:57:26 2015 +0100

    gbuild: stop disabling MSVC warning C4996 on --enable-dbgutil builds
    
    ... makes it hard to clean up these problems.
    
    But the warnings on almost every std::copy and std::transform are
    obnoxious, so disable them with _SCL_SECURE_NO_WARNINGS
    
    Change-Id: Ieea611175fb16b78ff972d194767d3d192992de5

diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index c5804a8..e02b581 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -40,10 +40,14 @@ ifneq ($(origin CXX),default)
 gb_CXX := $(CXX)
 endif
 
+# _SCL_SECURE_NO_WARNINGS avoids deprecation warnings for STL algorithms
+# like std::copy, std::transform (when MSVC_USE_DEBUG_RUNTIME is enabled)
+
 gb_COMPILERDEFS := \
 	-D_CRT_NON_CONFORMING_SWPRINTFS \
 	-D_CRT_NONSTDC_NO_DEPRECATE \
 	-D_CRT_SECURE_NO_DEPRECATE \
+	-D_SCL_SECURE_NO_WARNINGS \
 	-D_MT \
 	-D_DLL \
 	-DCPPU_ENV=$(gb_CPPU_ENV) \
@@ -63,8 +67,8 @@ gb_RCFLAGS :=
 
 gb_AFLAGS := $(AFLAGS)
 
-# Do we really need to disable to many warnings? It seems to me that
-# many of these warnings are for custructs that we have been actively
+# Do we really need to disable this many warnings? It seems to me that
+# many of these warnings are for constructs that we have been actively
 # cleaning away from the code, to avoid warnings when building with
 # gcc or Clang and -Wall -Werror.
 
@@ -129,9 +133,6 @@ gb_AFLAGS := $(AFLAGS)
 # C4913: user defined binary operator ',' exists but no overload could
 #    convert all operands, default built-in binary operator ',' used
 
-# C4996: 'function': was declared deprecated
-#   Also generated for C++ library functions that "may be unsafe"
-
 gb_CFLAGS := \
 	-Gd \
 	-GR \
@@ -184,11 +185,6 @@ gb_CXXFLAGS := \
 	-wd4913 \
 	-Zc:wchar_t- \
 
-ifneq ($(MSVC_USE_DEBUG_RUNTIME),)
-gb_CXXFLAGS += \
-	-wd4996 \
-
-endif
 
 ifneq ($(ENABLE_LTO),)
 
commit 19bfe765a50a81f67325c4fd35314ca8a2e4ca0a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 21:41:19 2015 +0100

    shell: warning C4996 function call with parameters that may be unsafe
    
    Change-Id: Id70289b0c88dd203cac6301303fe7452088f60f9

diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx
index 29cb838..8686898 100644
--- a/shell/source/win32/shlxthandler/infotips/infotips.cxx
+++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx
@@ -289,7 +289,7 @@ HRESULT STDMETHODCALLTYPE CInfoTip::GetInfoTip(DWORD /*dwFlags*/, wchar_t** ppws
 
         ZeroMemory(pMem, len);
 
-        msg.copy(pMem,msg.length());
+        wcscpy_s(pMem, msg.length(), msg.c_str());
 
         *ppwszTip = pMem;
         lpMalloc->Release();
commit a63938194e936332d7c4cf8ee9d73af8c5a15c17
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Mar 5 12:40:44 2015 +0100

    sd: BluetoothServer: fix deprecation warning C4996, use WSAQUERYSETW
    
    Change-Id: I07e6757f447ad1c4514f2ddcdf26589190445870

diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index 72ca128..648b60b 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -1366,17 +1366,17 @@ void SAL_CALL BluetoothServer::run()
 //    ULONGLONG aData4 = 0x800000805F9B34FB;
 //    memcpy( uuid.Data4, &aData4, sizeof(uuid.Data4) );
 
-    WSAQUERYSET aRecord;
+    WSAQUERYSETW aRecord;
     memset( &aRecord, 0, sizeof(aRecord));
     aRecord.dwSize = sizeof(aRecord);
-    aRecord.lpszServiceInstanceName = (char *)"LibreOffice Impress Remote Control";
-    aRecord.lpszComment = (char *)"Remote control of presentations over bluetooth.";
+    aRecord.lpszServiceInstanceName = L"LibreOffice Impress Remote Control";
+    aRecord.lpszComment = L"Remote control of presentations over bluetooth.";
     aRecord.lpServiceClassId = (LPGUID) &SerialPortServiceClass_UUID;
     aRecord.dwNameSpace = NS_BTH;
     aRecord.dwNumberOfCsAddrs = 1;
     aRecord.lpcsaBuffer = &aAddrInfo;
 
-    if ( WSASetService( &aRecord, RNRSERVICE_REGISTER, 0 ) == SOCKET_ERROR )
+    if (WSASetServiceW( &aRecord, RNRSERVICE_REGISTER, 0 ) == SOCKET_ERROR)
     {
         closesocket( aSocket );
         WSACleanup();
commit a829dac0c97df269616107e30d06980ca919dc15
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Mar 5 00:17:22 2015 +0100

    sal: replace usage of deprecated socket functions
    
    inet_ntoa, gethostbyname, gethostbyaddr are all deprecated in the
    Windows SDK 8.1; use the replacement functions unless targetting WinXP.
    
    Change-Id: Ic290ce925835c97f0ca0c611d1fd2675d0045ec7

diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index 88d0c4e..5ec52cf 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -819,6 +819,7 @@ oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname)
 
     if (__osl_attemptSocketDialupImpl())
     {
+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
         struct hostent *he;
         rtl_String     *Hostname= NULL;
 
@@ -830,6 +831,34 @@ oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname)
 
         rtl_string_release (Hostname);
         return __osl_hostentToHostAddr (he);
+#else
+        PADDRINFOW pAddrInfo = nullptr;
+        int ret = GetAddrInfoW(
+                    strHostname->buffer, nullptr, nullptr, & pAddrInfo);
+        if (0 == ret)
+        {
+            oslHostAddr pRet = nullptr;
+            for (PADDRINFOW pIter = pAddrInfo; pIter; pIter = pIter->ai_next)
+            {
+                if (AF_INET == pIter->ai_family)
+                {
+                    pRet = static_cast<oslHostAddr>(
+                        rtl_allocateZeroMemory(sizeof(struct oslHostAddrImpl)));
+                    rtl_uString_newFromStr(&pRet->pHostName, pIter->ai_canonname);
+                    pRet->pSockAddr = __osl_createSocketAddr();
+                    memcpy(& pRet->pSockAddr->m_sockaddr,
+                           pIter->ai_addr, pIter->ai_addrlen);
+                    break; // ignore other results
+                }
+            }
+            FreeAddrInfoW(pAddrInfo);
+            return pRet;
+        }
+        else
+        {
+            SAL_INFO("sal.osl", "GetAddrInfoW failed: " << WSAGetLastError());
+        }
+#endif // _WIN32_WINNT
     }
     return ((oslHostAddr)NULL);
 }
@@ -851,11 +880,34 @@ oslHostAddr SAL_CALL osl_createHostAddrByAddr(const oslSocketAddr pAddr)
 
         if (__osl_attemptSocketDialupImpl())
         {
+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
             struct hostent *he;
             he= gethostbyaddr ((const sal_Char *)&(sin->sin_addr),
                                sizeof (sin->sin_addr),
                                sin->sin_family);
             return __osl_hostentToHostAddr (he);
+#else
+            WCHAR buf[NI_MAXHOST];
+            int ret = GetNameInfoW(
+                        & pAddr->m_sockaddr, sizeof(struct sockaddr),
+                        buf, NI_MAXHOST,
+                        nullptr, 0, 0);
+            if (0 == ret)
+            {
+                oslHostAddr pRet = static_cast<oslHostAddr>(
+                        rtl_allocateZeroMemory(sizeof(struct oslHostAddrImpl)));
+                rtl_uString_newFromStr(&pRet->pHostName,
+                        reinterpret_cast<sal_Unicode*>(&buf));
+                pRet->pSockAddr = __osl_createSocketAddr();
+                memcpy(& pRet->pSockAddr->m_sockaddr,
+                       & pAddr->m_sockaddr, sizeof(struct sockaddr));
+                return pRet;
+            }
+            else
+            {
+                SAL_INFO("sal.osl", "GetNameInfoW failed: " << WSAGetLastError());
+            }
+#endif // _WIN32_WINNT
         }
     }
 
@@ -1093,8 +1145,6 @@ oslSocketResult SAL_CALL osl_getDottedInetAddrOfSocketAddr (
     oslSocketAddr   pAddr,
     rtl_uString   **strDottedInetAddr)
 {
-    sal_Char           *pDotted;
-
     if (pAddr == NULL)
         return osl_Socket_Error;
 
@@ -1102,10 +1152,24 @@ oslSocketResult SAL_CALL osl_getDottedInetAddrOfSocketAddr (
     if (pSystemInetAddr->sin_family != FAMILY_TO_NATIVE(osl_Socket_FamilyInet))
         return osl_Socket_Error;
 
-    pDotted = inet_ntoa (pSystemInetAddr->sin_addr);
+    *strDottedInetAddr = 0;
+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
+    sal_Char * pDotted = inet_ntoa (pSystemInetAddr->sin_addr);
     rtl_string2UString(
         strDottedInetAddr, pDotted, strlen (pDotted),
         RTL_TEXTENCODING_UTF8, OUSTRING_TO_OSTRING_CVTFLAGS);
+#else
+    WCHAR buf[16]; // 16 for IPV4, 46 for IPV6
+    PCWSTR ret = InetNtopW(
+            AF_INET, & pSystemInetAddr->sin_addr,
+            buf, SAL_N_ELEMENTS(buf));
+    if (nullptr == ret)
+    {
+        SAL_INFO("sal.osl", "InetNtopW failed: " << WSAGetLastError());
+        return osl_Socket_Error;
+    }
+    rtl_uString_newFromStr(strDottedInetAddr, ret);
+#endif // _WIN32_WINNT
     OSL_ASSERT(*strDottedInetAddr != 0);
 
     return osl_Socket_Ok;
commit e9975ecffcd32abbffade50124e9935521043e6f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 21:55:46 2015 +0100

    sal,sd: use newer InetPtonW API when not building for WinXP target
    
    ... i.e. decide based on target instead of SDK version.
    
    Change-Id: I225588d34f961c19e223ed9c1b9a934cd5196cf7

diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index 25eec51..88d0c4e 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -585,7 +585,7 @@ oslSocketAddr SAL_CALL osl_createInetBroadcastAddr (
     if (strDottedAddr && strDottedAddr->length)
     {
 // the Win32 SDK 8.1 deprecates inet_addr()
-#ifdef _WIN32_WINNT_WINBLUE
+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
         IN_ADDR addr;
         INT ret = InetPtonW(AF_INET, strDottedAddr->buffer, & addr);
         if (1 == ret)
@@ -648,7 +648,7 @@ oslSocketAddr SAL_CALL osl_createInetSocketAddr (
     sal_uInt32 Addr;
 
 // the Win32 SDK 8.1 deprecates inet_addr()
-#ifdef _WIN32_WINNT_WINBLUE
+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
     IN_ADDR addr;
     INT ret = InetPtonW(AF_INET, strDottedAddr->buffer, & addr);
     Addr = ret == 1 ? addr.S_un.S_addr : OSL_INADDR_NONE;
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index 5cd9907..32e9afb 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -123,7 +123,7 @@ void DiscoveryService::setupSockets()
     struct ip_mreq multicastRequest;
 
 // the Win32 SDK 8.1 deprecates inet_addr()
-#ifdef _WIN32_WINNT_WINBLUE
+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
     IN_ADDR addr;
     OUString const saddr("239.0.0.1");
     INT ret = InetPtonW(AF_INET, saddr.getStr(), & addr);
commit 8bb33cb289e02012985a8db9ab2dc21efcbcd24e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 14:26:55 2015 +0100

    connectivity: remove bogus setting of NTDDI_VERSION
    
    The value set here does not correspond to any valid value in
    sdkddkver.h; it is a mystery what setting an invalid value is supposed
    to achieve.
    
    Change-Id: I76b1da148806e249870154efda3e6c4fa20010bf

diff --git a/connectivity/CppunitTest_connectivity_ado.mk b/connectivity/CppunitTest_connectivity_ado.mk
index 1102d27..3160314 100644
--- a/connectivity/CppunitTest_connectivity_ado.mk
+++ b/connectivity/CppunitTest_connectivity_ado.mk
@@ -33,12 +33,6 @@ $(eval $(call gb_CppunitTest_add_cxxflags,connectivity_ado,\
 ))
 endif
 
-ifneq (,$(filter $(WINDOWS_SDK_VERSION),80 81))
-$(eval $(call gb_CppunitTest_add_defs,connectivity_ado,\
-	-DNTDDI_VERSION=0x0601 \
-))
-endif
-
 $(eval $(call gb_CppunitTest_add_exception_objects,connectivity_ado, \
 	connectivity/qa/connectivity/ado/DriverTest \
 ))
diff --git a/connectivity/CppunitTest_connectivity_commontools.mk b/connectivity/CppunitTest_connectivity_commontools.mk
index e9d6e98..146c6af 100644
--- a/connectivity/CppunitTest_connectivity_commontools.mk
+++ b/connectivity/CppunitTest_connectivity_commontools.mk
@@ -29,12 +29,6 @@ $(eval $(call gb_CppunitTest_add_cxxflags,connectivity_commontools,\
 endif
 endif
 
-ifeq ($(WINDOWS_SDK_VERSION),80)
-$(eval $(call gb_CppunitTest_add_defs,connectivity_commontools,\
-	-DNTDDI_VERSION=0x0601 \
-))
-endif
-
 # In mergedlibs mode we have multiply-defined symbols, which Visual Studio
 # does not like. There is no good solution, so just force it.
 ifeq ($(COM),MSC)
diff --git a/connectivity/Library_ado.mk b/connectivity/Library_ado.mk
index b2ebe1b..c5e74e1 100644
--- a/connectivity/Library_ado.mk
+++ b/connectivity/Library_ado.mk
@@ -36,12 +36,6 @@ $(eval $(call gb_Library_use_system_win32_libs,ado,\
 	uuid \
 ))
 
-ifneq (,$(filter $(WINDOWS_SDK_VERSION),80 81))
-$(eval $(call gb_Library_add_defs,ado,\
-	-DNTDDI_VERSION=0x0601 \
-))
-endif
-
 $(eval $(call gb_Library_use_libraries,ado,\
 	cppu \
 	cppuhelper \
commit b8d0203c809eaf49907c586f662453f4a8fda45b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 14:18:24 2015 +0100

    gbuild: on WNT, target Windows XP with 7.1 SDK, and Vista with 8.x SDK
    
    Since with the 8.x SDK it is not possible to target Windows XP anyway
    according to MSDN, just set _WIN32_WINNT to _WIN32_WINNT_VISTA so that
    we can at least work on cleaning up API calls deprecated in SDK 8.1.
    
    Change-Id: Ic433caf454f57187b91ef6fdec3f3bcde3f1af79

diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index 5602a03..ea0e476 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -21,11 +21,12 @@ gb_Helper_LIBRARY_PATH_VAR := PATH
 gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
 
 # define _WIN32_WINNT and WINVER will be derived from it in sdkddkver.h
+# with a 7.1 SDK target Windows XP, with 8.x SDK target Windows Vista
 # currently _WIN32_IE is defined to a higher version than would be derived
 # in sdkddkver.h from _WIN32_WINNT=0x0502 but if _WIN32_WINNT >= 0x0600
 # the derived value is sufficient
 gb_OSDEFS := \
-	-D_WIN32_WINNT=0x0502 \
+	-D_WIN32_WINNT=$(if $(filter 70,$(WINDOWS_SDK_VERSION)),0x0502,0x0600) \
 	-D_WIN32_IE=0x0700 \
 	-DWIN32 \
 	-DWNT \
commit d8dd6db19a9a37072a0dfbfc94f3690750ebd219
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 13:51:36 2015 +0100

    gbuild: set _WIN32_WINNT globally instead of WINVER
    
    ... and remove the definitions in makefiles, except in fpicker, which
    defines a different value for the Vista file picker.
    
    The WINVER value is derived automatically from _WIN32_WINNT by SDK
    header sdkddkver.h.
    
    Change-Id: I73358a9bf5d070f71821654cae2a29335a754a21

diff --git a/canvas/Library_cairocanvas.mk b/canvas/Library_cairocanvas.mk
index da2ec7f..72d1b8d 100644
--- a/canvas/Library_cairocanvas.mk
+++ b/canvas/Library_cairocanvas.mk
@@ -70,10 +70,6 @@ $(eval $(call gb_Library_use_externals,cairocanvas,\
 
 ifeq ($(OS),WNT)
 
-$(eval $(call gb_Library_add_defs,cairocanvas,\
-	-D_WIN32_WINNT=0x0502 \
-))
-
 $(eval $(call gb_Library_add_exception_objects,cairocanvas,\
 	canvas/source/cairo/cairo_win32_cairo \
 ))
diff --git a/connectivity/Library_ado.mk b/connectivity/Library_ado.mk
index dbe53b4..b2ebe1b 100644
--- a/connectivity/Library_ado.mk
+++ b/connectivity/Library_ado.mk
@@ -36,12 +36,6 @@ $(eval $(call gb_Library_use_system_win32_libs,ado,\
 	uuid \
 ))
 
-ifeq ($(OS),WNT)
-$(eval $(call gb_Library_add_defs,ado,\
-	-D_WIN32_WINNT=0x0502 \
-))
-endif
-
 ifneq (,$(filter $(WINDOWS_SDK_VERSION),80 81))
 $(eval $(call gb_Library_add_defs,ado,\
 	-DNTDDI_VERSION=0x0601 \
diff --git a/desktop/Library_deploymentgui.mk b/desktop/Library_deploymentgui.mk
index 4791897..cca6211 100644
--- a/desktop/Library_deploymentgui.mk
+++ b/desktop/Library_deploymentgui.mk
@@ -44,10 +44,6 @@ $(eval $(call gb_Library_use_libraries,deploymentgui,\
 
 ifeq ($(OS),WNT)
 
-$(eval $(call gb_Library_add_defs,deploymentgui,\
-    -D_WIN32_WINNT=0x0502 \
-))
-
 $(eval $(call gb_Library_use_system_win32_libs,deploymentgui,\
     ole32 \
 ))
diff --git a/embeddedobj/Library_emboleobj.mk b/embeddedobj/Library_emboleobj.mk
index e10110b..8878045 100644
--- a/embeddedobj/Library_emboleobj.mk
+++ b/embeddedobj/Library_emboleobj.mk
@@ -17,10 +17,6 @@ $(eval $(call gb_Library_set_include,emboleobj,\
 	$$(INCLUDE) \
 ))
 
-$(eval $(call gb_Library_add_defs,emboleobj,\
-	-D_WIN32_WINNT=0x0502 \
-))
-
 $(eval $(call gb_Library_use_external,emboleobj,boost_headers))
 
 $(eval $(call gb_Library_use_sdk_api,emboleobj))
diff --git a/embedserv/Library_emser.mk b/embedserv/Library_emser.mk
index 6ff4223..904baa4 100644
--- a/embedserv/Library_emser.mk
+++ b/embedserv/Library_emser.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_Library_set_include,emser,\
 
 $(eval $(call gb_Library_add_defs,emser,\
 	-UNOMINMAX \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_use_external,emser,boost_headers))
diff --git a/extensions/Library_oleautobridge.mk b/extensions/Library_oleautobridge.mk
index 7bf936e..cd3823b 100644
--- a/extensions/Library_oleautobridge.mk
+++ b/extensions/Library_oleautobridge.mk
@@ -24,10 +24,6 @@ $(eval $(call gb_Library_add_ldflags,oleautobridge,\
 	-LIBPATH:$(ATL_LIB) \
 ))
 
-$(eval $(call gb_Library_add_defs,oleautobridge,\
-	-D_WIN32_WINNT=0x0502 \
-))
-
 $(eval $(call gb_Library_use_external,oleautobridge,boost_headers))
 
 $(eval $(call gb_Library_use_libraries,oleautobridge,\
diff --git a/external/boost/StaticLibrary_boostthread.mk b/external/boost/StaticLibrary_boostthread.mk
index b9c165a..77b6ea1 100644
--- a/external/boost/StaticLibrary_boostthread.mk
+++ b/external/boost/StaticLibrary_boostthread.mk
@@ -13,10 +13,6 @@ $(eval $(call gb_StaticLibrary_use_unpacked,boostthread,boost))
 
 $(eval $(call gb_StaticLibrary_set_warnings_not_errors,boostthread))
 
-$(eval $(call gb_StaticLibrary_add_defs,boostthread,\
-       -D_WIN32_WINNT=0x0502 \
-))
-
 # disable "auto link" "feature" on MSVC
 $(eval $(call gb_StaticLibrary_add_defs,boostthread,\
 	-DBOOST_ALL_NO_LIB \
diff --git a/setup_native/Library_sellangmsi.mk b/setup_native/Library_sellangmsi.mk
index 3f8947f..2df29fc 100644
--- a/setup_native/Library_sellangmsi.mk
+++ b/setup_native/Library_sellangmsi.mk
@@ -15,7 +15,6 @@ $(eval $(call gb_Library_use_custom_headers,sellangmsi,\
 
 $(eval $(call gb_Library_add_defs,sellangmsi,\
 	-U_DLL \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_add_cxxflags,sellangmsi,\
diff --git a/setup_native/Library_shlxtmsi.mk b/setup_native/Library_shlxtmsi.mk
index 00e3bf2..ae619e6 100644
--- a/setup_native/Library_shlxtmsi.mk
+++ b/setup_native/Library_shlxtmsi.mk
@@ -13,7 +13,6 @@ $(eval $(call gb_Library_use_external,shlxtmsi,boost_headers))
 
 $(eval $(call gb_Library_add_defs,shlxtmsi,\
 	-U_DLL \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_add_cxxflags,shlxtmsi,\
diff --git a/shell/Library_ooofilt.mk b/shell/Library_ooofilt.mk
index 490a89a..d7897ca 100644
--- a/shell/Library_ooofilt.mk
+++ b/shell/Library_ooofilt.mk
@@ -19,7 +19,6 @@ $(eval $(call gb_Library_add_defs,ooofilt,\
 	-DUNICODE \
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
-	-D_WIN32_WINNT=0x0502 \
 	-UNOMINMAX \
 ))
 
diff --git a/shell/Library_ooofilt_x64.mk b/shell/Library_ooofilt_x64.mk
index a690c41..26f85ce 100644
--- a/shell/Library_ooofilt_x64.mk
+++ b/shell/Library_ooofilt_x64.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_add_defs,ooofilt_x64,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_use_externals,ooofilt_x64,\
diff --git a/shell/Library_propertyhdl.mk b/shell/Library_propertyhdl.mk
index 5073988..31f433a 100644
--- a/shell/Library_propertyhdl.mk
+++ b/shell/Library_propertyhdl.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_Library_add_defs,propertyhdl,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_use_externals,propertyhdl,\
diff --git a/shell/Library_propertyhdl_x64.mk b/shell/Library_propertyhdl_x64.mk
index 64f9b99..cd18928 100644
--- a/shell/Library_propertyhdl_x64.mk
+++ b/shell/Library_propertyhdl_x64.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_add_defs,propertyhdl_x64,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_use_externals,propertyhdl_x64,\
diff --git a/shell/Library_shlxthdl.mk b/shell/Library_shlxthdl.mk
index 0c0b3e7..30e8f58 100644
--- a/shell/Library_shlxthdl.mk
+++ b/shell/Library_shlxthdl.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_Library_add_defs,shlxthdl,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_use_externals,shlxthdl,\
diff --git a/shell/Library_shlxthdl_x64.mk b/shell/Library_shlxthdl_x64.mk
index 88fdfa8..a539b72 100644
--- a/shell/Library_shlxthdl_x64.mk
+++ b/shell/Library_shlxthdl_x64.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_add_defs,shlxthdl_x64,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_Library_use_externals,shlxthdl_x64,\
diff --git a/shell/StaticLibrary_shlxthandler_common.mk b/shell/StaticLibrary_shlxthandler_common.mk
index 6c5851b..553418d 100644
--- a/shell/StaticLibrary_shlxthandler_common.mk
+++ b/shell/StaticLibrary_shlxthandler_common.mk
@@ -19,7 +19,6 @@ $(eval $(call gb_StaticLibrary_add_defs,shlxthandler_common,\
 	-DUNICODE \
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_StaticLibrary_use_externals,shlxthandler_common,\
diff --git a/shell/StaticLibrary_shlxthandler_common_x64.mk b/shell/StaticLibrary_shlxthandler_common_x64.mk
index 0af6202..9470438 100644
--- a/shell/StaticLibrary_shlxthandler_common_x64.mk
+++ b/shell/StaticLibrary_shlxthandler_common_x64.mk
@@ -25,7 +25,6 @@ $(eval $(call gb_StaticLibrary_add_defs,shlxthandler_common_x64,\
 	-DUNICODE \
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
-	-D_WIN32_WINNT=0x0502 \
 ))
 
 $(eval $(call gb_StaticLibrary_use_externals,shlxthandler_common_x64,\
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index cd71cff..5602a03 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -20,11 +20,12 @@ gb_Helper_LIBRARY_PATH_VAR := PATH
 
 gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
 
+# define _WIN32_WINNT and WINVER will be derived from it in sdkddkver.h
 # currently _WIN32_IE is defined to a higher version than would be derived
 # in sdkddkver.h from _WIN32_WINNT=0x0502 but if _WIN32_WINNT >= 0x0600
 # the derived value is sufficient
 gb_OSDEFS := \
-	-DWINVER=0x0502 \
+	-D_WIN32_WINNT=0x0502 \
 	-D_WIN32_IE=0x0700 \
 	-DWIN32 \
 	-DWNT \
commit fe045dca6124c9627c1cfa9dac4072ae75292910
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 17:05:47 2015 +0100

    vcl: tweak some optional usage of Windows 7 or later symbols...
    
    ... so that -D_WIN32_WINNT=0x0502 does not break the build.
    
    Change-Id: I423ba9c194dc4928d59e1713255bce9c3150bcc2

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 4e048a1..838a882 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -85,6 +85,10 @@
 
 #ifdef _WIN32
 // WinCrypt headers for PDF signing
+// Note: this uses Windows 7 APIs and requires the relevant data types;
+// the functions that don't exist in WinXP must be looked up at runtime!
+#undef _WIN32_WINNT
+#define _WIN32_WINNT _WIN32_WINNT_WIN7
 #include <prewin.h>
 #include <wincrypt.h>
 #include <postwin.h>
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 1070c05..1ef22b2 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -1001,6 +1001,11 @@ void WinSalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUS
                         OUString sApplicationID("TheDocumentFoundation.LibreOffice.");
                         sApplicationID += sApplicationName;
 
+#if _WIN32_WINNT < _WIN32_WINNT_WIN7
+// just define Windows 7 only constant locally...
+#define SHARD_APPIDINFO  0x00000004
+#endif
+
                         typedef struct {
                             IShellItem *psi;
                             PCWSTR     pszAppID;
commit b3f6c29626965842fe0437f2c02a703883ec8cd1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 13:17:17 2015 +0100

    shell: remove unnecessary explicit -D_WIN32_IE
    
    Change-Id: Ib6d9233e8c322fd7165fce8763bb2a4eee9a7850

diff --git a/shell/Library_ooofilt.mk b/shell/Library_ooofilt.mk
index f997eea..490a89a 100644
--- a/shell/Library_ooofilt.mk
+++ b/shell/Library_ooofilt.mk
@@ -19,7 +19,6 @@ $(eval $(call gb_Library_add_defs,ooofilt,\
 	-DUNICODE \
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 	-UNOMINMAX \
 ))
diff --git a/shell/Library_ooofilt_x64.mk b/shell/Library_ooofilt_x64.mk
index 8f994dc..a690c41 100644
--- a/shell/Library_ooofilt_x64.mk
+++ b/shell/Library_ooofilt_x64.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_add_defs,ooofilt_x64,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 ))
 
diff --git a/shell/Library_propertyhdl.mk b/shell/Library_propertyhdl.mk
index 6ea684f..5073988 100644
--- a/shell/Library_propertyhdl.mk
+++ b/shell/Library_propertyhdl.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_Library_add_defs,propertyhdl,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 ))
 
diff --git a/shell/Library_propertyhdl_x64.mk b/shell/Library_propertyhdl_x64.mk
index 29f3899..64f9b99 100644
--- a/shell/Library_propertyhdl_x64.mk
+++ b/shell/Library_propertyhdl_x64.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_add_defs,propertyhdl_x64,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 ))
 
diff --git a/shell/Library_shlxthdl.mk b/shell/Library_shlxthdl.mk
index f79dc85..0c0b3e7 100644
--- a/shell/Library_shlxthdl.mk
+++ b/shell/Library_shlxthdl.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_Library_add_defs,shlxthdl,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 ))
 
diff --git a/shell/Library_shlxthdl_x64.mk b/shell/Library_shlxthdl_x64.mk
index dfd694d..88fdfa8 100644
--- a/shell/Library_shlxthdl_x64.mk
+++ b/shell/Library_shlxthdl_x64.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_add_defs,shlxthdl_x64,\
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
 	-UNOMINMAX \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 ))
 
diff --git a/shell/StaticLibrary_shlxthandler_common.mk b/shell/StaticLibrary_shlxthandler_common.mk
index e6a47ac..6c5851b 100644
--- a/shell/StaticLibrary_shlxthandler_common.mk
+++ b/shell/StaticLibrary_shlxthandler_common.mk
@@ -19,7 +19,6 @@ $(eval $(call gb_StaticLibrary_add_defs,shlxthandler_common,\
 	-DUNICODE \
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 ))
 
diff --git a/shell/StaticLibrary_shlxthandler_common_x64.mk b/shell/StaticLibrary_shlxthandler_common_x64.mk
index 3456c0b..0af6202 100644
--- a/shell/StaticLibrary_shlxthandler_common_x64.mk
+++ b/shell/StaticLibrary_shlxthandler_common_x64.mk
@@ -25,7 +25,6 @@ $(eval $(call gb_StaticLibrary_add_defs,shlxthandler_common_x64,\
 	-DUNICODE \
 	-DWIN32_LEAN_AND_MEAN \
 	-D_UNICODE \
-	-D_WIN32_IE=0x700 \
 	-D_WIN32_WINNT=0x0502 \
 ))
 
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index a7ab73d..cd71cff 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -20,6 +20,9 @@ gb_Helper_LIBRARY_PATH_VAR := PATH
 
 gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
 
+# currently _WIN32_IE is defined to a higher version than would be derived
+# in sdkddkver.h from _WIN32_WINNT=0x0502 but if _WIN32_WINNT >= 0x0600
+# the derived value is sufficient
 gb_OSDEFS := \
 	-DWINVER=0x0502 \
 	-D_WIN32_IE=0x0700 \
commit 5ec422c3f0a66f3f5e3db7ccc5e84e5a516457be
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 12:59:19 2015 +0100

    fpicker: remove checks for obsolete _WIN32_WINNT versions
    
    Change-Id: Ie354e0237b97c872936bd0c87ad014ffc2ba56da

diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.hxx b/fpicker/source/win32/filepicker/FileOpenDlg.hxx
index 054f746..754c81e 100644
--- a/fpicker/source/win32/filepicker/FileOpenDlg.hxx
+++ b/fpicker/source/win32/filepicker/FileOpenDlg.hxx
@@ -61,11 +61,9 @@ typedef struct _tagOFNA {
    LPEDITMENU   lpEditInfo;
    LPCSTR       lpstrPrompt;
 #endif
-#if (_WIN32_WINNT >= 0x0500)
    void *       pvReserved;
    DWORD        dwReserved;
    DWORD        FlagsEx;
-#endif // (_WIN32_WINNT >= 0x0500)
 } _OPENFILENAMEA, *_LPOPENFILENAMEA;
 
 typedef struct _tagOFNW {
@@ -89,11 +87,9 @@ typedef struct _tagOFNW {
    LPARAM       lCustData;
    LPOFNHOOKPROC lpfnHook;
    LPCWSTR      lpTemplateName;
-#if (_WIN32_WINNT >= 0x0500)
    void *       pvReserved;
    DWORD        dwReserved;
    DWORD        FlagsEx;
-#endif // (_WIN32_WINNT >= 0x0500)
 } _OPENFILENAMEW, *_LPOPENFILENAMEW;
 
 #ifdef UNICODE
commit d6cd5de3211a344d7f6fa8585f21dfb8be0a06f3
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 4 14:10:41 2015 +0100

    configure: Windows SDKs < 7.1 are not supported, do not check for them
    
    Change-Id: I3558ca7fa3d2a2c47d1066e3bd24aeb7619452e0

diff --git a/configure.ac b/configure.ac
index 6c3dbfc..dadc82f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9567,13 +9567,7 @@ the  Windows SDK are installed.])
 
     if test -z "$WINDOWS_SDK_HOME"; then
         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
-    elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
-        WINDOWS_SDK_VERSION=60
-        AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
-    elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
-        WINDOWS_SDK_VERSION=61
-        AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
-    elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
+    elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
         WINDOWS_SDK_VERSION=70
         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
     elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
@@ -9582,9 +9576,9 @@ the  Windows SDK are installed.])
         dnl compatibility warning if not explicitly choosing the 80 SDK:
         if test -z "$with_windows_sdk"; then
             AC_MSG_WARN([If a build should run on Windows XP,])
-            AC_MSG_WARN([use --with-windows-sdk=7.1A (requires VS 2012 Update 1 or newer)])
+            AC_MSG_WARN([use --with-windows-sdk=7.1A])
             add_warning "If a build should run on Windows XP,"
-            add_warning "use --with-windows-sdk=7.1A (requires VS 2012 Update 1 or newer)"
+            add_warning "use --with-windows-sdk=7.1A"
         fi
     elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
         WINDOWS_SDK_VERSION=81


More information about the Libreoffice-commits mailing list