bin/update_pch                       |    2 --
 compilerplugins/clang/reservedid.cxx |    1 +
 configure.ac                         |   19 +++----------------
 sal/inc/pch/precompiled_sal.hxx      |    2 --
 sal/osl/w32/random.cxx               |    2 --
 5 files changed, 4 insertions(+), 22 deletions(-)

New commits:
commit b18c2a0024c6d33cdf142ed2adf0d127483411e8
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Fri Nov 26 09:17:04 2021 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Fri Nov 26 10:28:44 2021 +0100

    -FIIntrin.h in CC/CXX is no longer needed for my clang-cl build
    
    ...at least with Clang 14 trunk now (but I didn't check which llvm commit 
would
    be responsible for that, and which version of LLVM that appeared in first).
    
    That also means the -D_CRT_RAND_S hack in CXX is no longer needed either.  
(See
    the mail thread starting at
    <https://lists.llvm.org/pipermail/cfe-dev/2015-November/046012.html> 
"[cfe-dev]
    clang-cl question".)
    
    Change-Id: If1b1b4fa17782161c3b72ac68fdef28b0e044a31
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125859
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/bin/update_pch b/bin/update_pch
index eb9631e80d80..1cb5cb9979a6 100755
--- a/bin/update_pch
+++ b/bin/update_pch
@@ -888,10 +888,8 @@ def generate(includes, libname, filename, module):
         if module == 'sal' and libname == 'sal':
             sal_define = """
 #if defined(_WIN32)
-#if !defined _CRT_RAND_S
 #define _CRT_RAND_S
 #endif
-#endif
 """
             f.write(sal_define)
 
diff --git a/compilerplugins/clang/reservedid.cxx 
b/compilerplugins/clang/reservedid.cxx
index 9f11ef5a9ced..2c7e9c8659e4 100644
--- a/compilerplugins/clang/reservedid.cxx
+++ b/compilerplugins/clang/reservedid.cxx
@@ -74,6 +74,7 @@ void ReservedId::postRun() {
                     // extensions/source/activex/StdAfx2.h
                 && id != "_ATL_STATIC_REGISTRY"
                     // extensions/source/activex/StdAfx2.h
+                && id != "_CRT_RAND_S" // sal/osl/w32/random.cxx
                 && id != "_GLIBCXX_CDTOR_CALLABI"
                 && id != "_HAS_AUTO_PTR_ETC" // unotools/source/i18n/resmgr.cxx
                 && id != "_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" // 
unotools/source/i18n/resmgr.cxx
diff --git a/configure.ac b/configure.ac
index 3d583bb00c5f..a3006f83169c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4245,7 +4245,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
     [AC_MSG_RESULT([no])])
 AC_SUBST(COM_IS_CLANG)
 
-CC_PLAIN=$CC
 CLANGVER=
 if test "$COM_IS_CLANG" = TRUE; then
     AC_MSG_CHECKING([whether Clang is new enough])
@@ -4263,23 +4262,11 @@ if test "$COM_IS_CLANG" = TRUE; then
         if test "$_os" = WINNT; then
             dnl In which case, assume clang-cl:
             my_args="/EP /TC"
-            dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
-            dnl clang-cl:
-            CC_PLAIN=
-            for i in $CC; do
-                case $i in
-                -FIIntrin.h)
-                    ;;
-                *)
-                    CC_PLAIN="$CC_PLAIN $i"
-                    ;;
-                esac
-            done
         else
             my_args="-E -P"
         fi
-        clang_version=`echo 
__clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args - | 
sed 's/ //g'`
-        CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
+        clang_version=`echo 
__clang_major__.__clang_minor__.__clang_patchlevel__ | $CC $my_args - | sed 's/ 
//g'`
+        CLANG_FULL_VERSION=`echo __clang_version__ | $CC $my_args -`
         CLANGVER=`echo $clang_version \
             | $AWK -F. '{ print 
\$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
         if test "$CLANGVER" -ge 50002; then
@@ -4298,7 +4285,7 @@ if test "$_os" = WINNT; then
     dnl localized
     AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
     echo "#include <stdlib.h>" > conftest.c
-    SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 
2>/dev/null | \
+    SHOWINCLUDES_PREFIX=`$CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | 
\
         grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
     rm -f conftest.c conftest.obj
     if test -z "$SHOWINCLUDES_PREFIX"; then
diff --git a/sal/inc/pch/precompiled_sal.hxx b/sal/inc/pch/precompiled_sal.hxx
index 94d43211d1c8..006c691a31e6 100644
--- a/sal/inc/pch/precompiled_sal.hxx
+++ b/sal/inc/pch/precompiled_sal.hxx
@@ -21,10 +21,8 @@
 */
 
 #if defined(_WIN32)
-#if !defined _CRT_RAND_S
 #define _CRT_RAND_S
 #endif
-#endif
 
 #include <sal/config.h>
 #if PCH_LEVEL >= 1
diff --git a/sal/osl/w32/random.cxx b/sal/osl/w32/random.cxx
index c873a8d3b5f0..a2c364da2ebb 100644
--- a/sal/osl/w32/random.cxx
+++ b/sal/osl/w32/random.cxx
@@ -7,9 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#if !defined _CRT_RAND_S
 #define _CRT_RAND_S
-#endif
 
 #include <stdlib.h>
 #include <memory.h>

Reply via email to