diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-24 10:30:50 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-24 17:05:43 +0000 |
commit | 1786ddbde4b44575321aa6b9d9d367a964969063 (patch) | |
tree | e319a7f54e93fba1ac11c7e41e85d9fb042ef68e /basic | |
parent | ae51dfb2379a9e9183afa9a1e5ee4fe4f4f0f7ef (diff) |
Fix build in a specific VS2022 environment
Building CppunitTest_basic_macros using VS2022 failed for me reproducibly
for some time, with
make[1]: *** [C:/lo/src/core/solenv/gbuild/LinkTarget.mk:841: C:/lo/src/build/workdir/LinkTarget/CppunitTest/test_basic_macros.dll] Error 139
It is caused by linking odbccp32, and legacy_stdio_definitions required
by the latter with current versions of UCRT.
It seems to work OK for others; but being unable to find what's different
on my system, I have this workaround, using run-time loading instead.
Change-Id: Ic4094398f7510bc281dfa96f980f29f12f09d7ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147626
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/CppunitTest_basic_macros.mk | 2 | ||||
-rw-r--r-- | basic/qa/cppunit/test_vba.cxx | 9 |
2 files changed, 3 insertions, 8 deletions
diff --git a/basic/CppunitTest_basic_macros.mk b/basic/CppunitTest_basic_macros.mk index 83a9221369f0..361bd5bb2d2f 100644 --- a/basic/CppunitTest_basic_macros.mk +++ b/basic/CppunitTest_basic_macros.mk @@ -45,9 +45,7 @@ $(eval $(call gb_CppunitTest_use_libraries,basic_macros, \ ifeq ($(OS),WNT) $(eval $(call gb_CppunitTest_use_system_win32_libs,basic_macros, \ oleaut32 \ - legacy_stdio_definitions \ odbc32 \ - odbccp32 \ )) endif diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx index f048fee6dfda..b778d393019b 100644 --- a/basic/qa/cppunit/test_vba.cxx +++ b/basic/qa/cppunit/test_vba.cxx @@ -14,11 +14,7 @@ #include <comphelper/processfactory.hxx> #include <o3tl/char16_t2wchar_t.hxx> -#if !defined WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif -#include <windows.h> -#include <odbcinst.h> +#include <systools/win32/odbccp32.hxx> #endif using namespace ::com::sun::star; @@ -211,7 +207,8 @@ void VBATest::testMiscOLEStuff() const int nBufSize = 1024 * 4; wchar_t sBuf[nBufSize]; - SQLGetInstalledDriversW( sBuf, nBufSize, nullptr ); + if (!sal::systools::odbccp32().SQLGetInstalledDrivers(sBuf, nBufSize)) + return; const wchar_t *pODBCDriverName = sBuf; bool bFound = false; |