[Libreoffice-commits] core.git: config_host/config_global.h.in configure.ac include/sal

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 17 15:25:42 UTC 2020


 config_host/config_global.h.in |    2 --
 configure.ac                   |   16 ----------------
 include/sal/types.h            |    2 +-
 3 files changed, 1 insertion(+), 19 deletions(-)

New commits:
commit 92f6f9ec785f1009e2c94082a751696c74eaf236
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Apr 17 15:40:50 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Apr 17 17:25:03 2020 +0200

    No need for HAVE_GCC_PRAGMA_OPERATOR
    
    The _Pragma operator is a C99/C++11 feature, and we only need it for GCC and
    Clang anyway, to inject some
    
      #pragma GCC diagnostic ...
    
    directives.  (MSVC would only support it with the upcoming VS 2019 Version 16.6,
    see <https://devblogs.microsoft.com/cppblog/
    announcing-full-support-for-a-c-c-conformant-preprocessor-in-msvc/>.)
    
    Change-Id: I6de3611021a28ba13860f55e7ad005ad3fbbb5e2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92452
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index 951c2502ba9c..99da1d93e6c7 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -13,8 +13,6 @@ Any change in this header will cause a rebuild of almost everything.
 #define CONFIG_GLOBAL_H
 
 #define HAVE_GCC_BUILTIN_ATOMIC 0
-/* _Pragma */
-#define HAVE_GCC_PRAGMA_OPERATOR 0
 #define HAVE_GCC_DEPRECATED_MESSAGE 0
 #define HAVE_SYSLOG_H 0
 
diff --git a/configure.ac b/configure.ac
index 42945571edf9..309b298398c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6645,22 +6645,6 @@ return !(i != 0 && j != 0);
 AC_LANG_POP([C++])
 CXXFLAGS=$save_CXXFLAGS
 
-dnl _Pragma support (may require C++11)
-if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
-    AC_MSG_CHECKING([whether $CXX_BASE supports _Pragma operator])
-    AC_LANG_PUSH([C++])
-    save_CXXFLAGS=$CXXFLAGS
-    CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
-    AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-            _Pragma("GCC diagnostic ignored \"-Wformat\"")
-        ])], [
-            AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
-            AC_MSG_RESULT([yes])
-        ], [AC_MSG_RESULT([no])])
-    AC_LANG_POP([C++])
-    CXXFLAGS=$save_CXXFLAGS
-fi
-
 HAVE_GCC_FNO_SIZED_DEALLOCATION=
 if test "$GCC" = yes; then
     AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
diff --git a/include/sal/types.h b/include/sal/types.h
index 53cbd687497a..481657e9bc6c 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -489,7 +489,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
         SAL_WNODEPRECATED_DECLARATIONS_POP
 */
 
-#if HAVE_GCC_PRAGMA_OPERATOR
+#if defined LIBO_INTERNAL_ONLY && defined __GNUC__
 #define SAL_WNODEPRECATED_DECLARATIONS_PUSH \
     _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic push)) \
     _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic ignored "-Wdeprecated-declarations"))


More information about the Libreoffice-commits mailing list