external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk | 1 external/mariadb-connector-c/clang-cl.patch.0 | 11 ++++++++++ 2 files changed, 12 insertions(+)
New commits: commit 65ed581fc1cca7052665e53a149f78b06b44970a Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Sep 11 16:26:52 2018 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Sep 11 22:59:24 2018 +0200 clang-cl: Don't define "const" away in external/mariadb-connector-c Mimicing MSCV, clang-cl doesn't predefine __STDC__ (InitializeStandardPredefinedMacros in clang/lib/Frontend/InitPreprocessor.cpp) when LangOpts.MSVCCompat aka -fms-compatibility is set, which it is by default for clang-cl (Clang::ConstructJob in clang/lib/Driver/ToolChains/Clang.cpp). But clang-cl still needs to be called with /FIIntrin.h to preload declarations of intrinsics from the Clang-provided Intrin.h, some of which like unsigned char _bittest(long const *, long); both make use of "const" (which isn't defined away because the file is loaded so early) and are duplicated in the system-provided winnt.h---where the "const" /is/ defined away when that header is included later, causing "conflicting types" errors. ("Real" MSVC also runs into the #if defining "const" away, but it seems it happens to not have bad consequences there.) Change-Id: Ice92a059330bd945f8a3d9e5fa1635a01d08ad8b Reviewed-on: https://gerrit.libreoffice.org/60321 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk b/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk index 4318dbfa7aae..71af2847a5b2 100644 --- a/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk +++ b/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk @@ -31,6 +31,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,mariadb-connector-c,\ $(if $(filter MSC,$(COM)),external/mariadb-connector-c/mariadb-msvc.patch.1) \ external/mariadb-connector-c/mariadb-inline.patch.1 \ external/mariadb-connector-c/mariadb-CONC-104.patch.1 \ + external/mariadb-connector-c/clang-cl.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/mariadb-connector-c/clang-cl.patch.0 b/external/mariadb-connector-c/clang-cl.patch.0 new file mode 100644 index 000000000000..7a886e67cf7c --- /dev/null +++ b/external/mariadb-connector-c/clang-cl.patch.0 @@ -0,0 +1,11 @@ +--- libmariadb/getopt.c ++++ libmariadb/getopt.c +@@ -38,7 +38,7 @@ + #include <config.h> + #endif + +-#if (!defined (__STDC__) || !__STDC__) && !defined(MSDOS) && !defined(OS2) ++#if (!defined (__STDC__) || !__STDC__) && !defined(MSDOS) && !defined(OS2) && !(defined _MSC_VER && defined __clang__) + /* This is a separate conditional since some stdc systems + reject `defined (const)'. */ + #ifndef const _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits