Kaydet (Commit) 1e0feb5c authored tarafından Luboš Luňák's avatar Luboš Luňák

do not base feature checks on gcc version

Clang reports itself to be gcc4.2, so there fail there, instead use configure
checks.

Change-Id: Idb44a5c875b24a15546a6495de02a1b4af898443
üst 00657c3b
...@@ -225,6 +225,7 @@ export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@ ...@@ -225,6 +225,7 @@ export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
export HAVE_GCC_FNO_INLINE=@HAVE_GCC_FNO_INLINE@ export HAVE_GCC_FNO_INLINE=@HAVE_GCC_FNO_INLINE@
export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@ export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@
export HAVE_GCC_NO_LONG_DOUBLE=@HAVE_GCC_NO_LONG_DOUBLE@ export HAVE_GCC_NO_LONG_DOUBLE=@HAVE_GCC_NO_LONG_DOUBLE@
export HAVE_GCC_PRAGMA_OPERATOR=@HAVE_GCC_PRAGMA_OPERATOR@
export HAVE_GCC_VISIBILITY_BROKEN=@HAVE_GCC_VISIBILITY_BROKEN@ export HAVE_GCC_VISIBILITY_BROKEN=@HAVE_GCC_VISIBILITY_BROKEN@
export HAVE_GCC_VISIBILITY_FEATURE=@HAVE_GCC_VISIBILITY_FEATURE@ export HAVE_GCC_VISIBILITY_FEATURE=@HAVE_GCC_VISIBILITY_FEATURE@
export HAVE_GETOPT=@HAVE_GETOPT@ export HAVE_GETOPT=@HAVE_GETOPT@
......
...@@ -21,6 +21,9 @@ Any change in this header will cause a rebuild of almost everything. ...@@ -21,6 +21,9 @@ Any change in this header will cause a rebuild of almost everything.
#define HAVE_GCC_BUILTIN_ATOMIC 0 #define HAVE_GCC_BUILTIN_ATOMIC 0
#define HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY 0 #define HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY 0
#define HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE 0 #define HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE 0
/* _Pragma */
#define HAVE_GCC_PRAGMA_OPERATOR 0
#define HAVE_GCC_DEPRECATED_MESSAGE 0
#define HAVE_THREADSAFE_STATICS 0 #define HAVE_THREADSAFE_STATICS 0
#define HAVE_SYSLOG_H 0 #define HAVE_SYSLOG_H 0
/* Compiler supports __attribute__((warn_unused)). */ /* Compiler supports __attribute__((warn_unused)). */
......
...@@ -5718,6 +5718,17 @@ if test "$GCC" = "yes"; then ...@@ -5718,6 +5718,17 @@ if test "$GCC" = "yes"; then
], [AC_MSG_RESULT([no])]) ], [AC_MSG_RESULT([no])])
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
__attribute__((deprecated(test))) void f();
])], [
AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
CFLAGS=$save_CFLAGS
AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h]) AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
...@@ -6086,6 +6097,25 @@ if test "$HAVE_CXX11" = "TRUE"; then ...@@ -6086,6 +6097,25 @@ if test "$HAVE_CXX11" = "TRUE"; then
fi fi
fi fi
HAVE_GCC_PRAGMA_OPERATOR=
dnl _Pragma support (may require C++11)
if test "$GCC" = "yes"; then
AC_MSG_CHECKING([whether $CXX 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])
HAVE_GCC_PRAGMA_OPERATOR=1
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
AC_LANG_POP([C++])
CXXFLAGS=$save_CXXFLAGS
fi
AC_SUBST(HAVE_GCC_PRAGMA_OPERATOR)
dnl =================================================================== dnl ===================================================================
dnl system stl sanity tests dnl system stl sanity tests
dnl =================================================================== dnl ===================================================================
......
...@@ -469,7 +469,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) { ...@@ -469,7 +469,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
SAL_DEPRECATED("Dont use, its evil.") void doit(int nPara); SAL_DEPRECATED("Dont use, its evil.") void doit(int nPara);
*/ */
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) #if HAVE_GCC_DEPRECATED_MESSAGE
# define SAL_DEPRECATED(message) __attribute__((deprecated(message))) # define SAL_DEPRECATED(message) __attribute__((deprecated(message)))
#elif (__GNUC__) #elif (__GNUC__)
# define SAL_DEPRECATED(message) __attribute__((deprecated)) # define SAL_DEPRECATED(message) __attribute__((deprecated))
...@@ -501,7 +501,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) { ...@@ -501,7 +501,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
SAL_WNODEPRECATED_DECLARATIONS_POP SAL_WNODEPRECATED_DECLARATIONS_POP
*/ */
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__) #if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE && HAVE_GCC_PRAGMA_OPERATOR
#define SAL_WNODEPRECATED_DECLARATIONS_PUSH \ #define SAL_WNODEPRECATED_DECLARATIONS_PUSH \
_Pragma(SAL_STRINGIFY_ARG(GCC diagnostic push)) \ _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic push)) \
_Pragma(SAL_STRINGIFY_ARG(GCC diagnostic ignored "-Wdeprecated-declarations")) _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic ignored "-Wdeprecated-declarations"))
......
...@@ -98,7 +98,7 @@ gb_CXXFLAGS += -std=c++0x ...@@ -98,7 +98,7 @@ gb_CXXFLAGS += -std=c++0x
#When we are using 4.6.0 we can use gcc pragmas to selectively silence auto_ptr #When we are using 4.6.0 we can use gcc pragmas to selectively silence auto_ptr
#warnings in isolation, but for <= 4.5.X we need to globally disable #warnings in isolation, but for <= 4.5.X we need to globally disable
#deprecation #deprecation
ifeq ($(gb_GccLess460),1) ifeq ($(HAVE_GCC_PRAGMA_OPERATOR),)
gb_CXXFLAGS += -Wno-deprecated-declarations gb_CXXFLAGS += -Wno-deprecated-declarations
endif endif
endif endif
......
...@@ -94,7 +94,7 @@ gb_CXXFLAGS += $(CXXFLAGS_CXX11) ...@@ -94,7 +94,7 @@ gb_CXXFLAGS += $(CXXFLAGS_CXX11)
#When we are using 4.6.0 we can use gcc pragmas to selectively silence auto_ptr #When we are using 4.6.0 we can use gcc pragmas to selectively silence auto_ptr
#warnings in isolation, but for <= 4.5.X we need to globally disable #warnings in isolation, but for <= 4.5.X we need to globally disable
#deprecation #deprecation
ifeq ($(gb_GccLess460),1) ifeq ($(HAVE_GCC_PRAGMA_OPERATOR),)
gb_CXXFLAGS += -Wno-deprecated-declarations gb_CXXFLAGS += -Wno-deprecated-declarations
endif endif
endif endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment