Fail with #error early if the compiler does not support bool or explicit.
authorStephen Kelly <stephen.kelly@kdab.com>
Tue, 21 Feb 2012 16:27:39 +0000 (17:27 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 22 Feb 2012 15:21:32 +0000 (16:21 +0100)
The fail mode for bool is moved from later in qglobal.h, and explicit is
used unguarded throughout Qt, so the macro is already useless.

Change-Id: Iff26892b025ba155e360a1f2dc93a67a6622dbc1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/global/qcompilerdetection.h
src/corelib/global/qglobal.h

index 5ab7909..8adbdbe 100644 (file)
@@ -76,7 +76,7 @@
 #  define Q_CC_SYM
 /* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
 #  if defined(__SC__) && __SC__ < 0x750
-#    define Q_NO_EXPLICIT_KEYWORD
+#    error "Compiler not supported"
 #  endif
 #  define Q_NO_USING_KEYWORD
 
 #  define Q_CC_BOR
 #  define Q_INLINE_TEMPLATE
 #  if __BORLANDC__ < 0x502
-#    define Q_NO_BOOL_TYPE
-#    define Q_NO_EXPLICIT_KEYWORD
+#    error "Compiler not supported"
 #  endif
 #  define Q_NO_USING_KEYWORD
 
 #  define Q_CC_XLC
 #  define Q_FULL_TEMPLATE_INSTANTIATION
 #  if __xlC__ < 0x400
-#    define Q_NO_BOOL_TYPE
-#    define Q_NO_EXPLICIT_KEYWORD
-#    define Q_NO_USING_KEYWORD
-#    define Q_OUTOFLINE_TEMPLATE inline
-#    define Q_BROKEN_TEMPLATE_SPECIALIZATION
-#    define Q_CANNOT_DELETE_CONSTANT
+#    error "Compiler not supported"
 #  elif __xlC__ >= 0x0600
 #    define Q_ALIGNOF(type)     __alignof__(type)
 #    define Q_TYPEOF(expr)      __typeof__(expr)
    - observed on Compaq C++ V6.3-002.
    In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
 #  if !defined(_BOOL_EXISTS)
-#    define Q_NO_BOOL_TYPE
+#    error "Compiler not supported"
 #  endif
 /* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
 #  define Q_NO_USING_KEYWORD
    __BOOL_DEFINED
         Defined in Microsoft C++ mode when bool is a keyword. */
 #  if !defined(_BOOL) && !defined(__BOOL_DEFINED)
-#    define Q_NO_BOOL_TYPE
+#    error "Compiler not supported"
 #  endif
 
 /* The Comeau compiler is based on EDG and does define __EDG__ */
 
 #  elif defined(__DCC__)
 #    define Q_CC_DIAB
-#    undef Q_NO_BOOL_TYPE
 #    if !defined(__bool)
-#      define Q_NO_BOOL_TYPE
+#      error "Compiler not supported"
 #    endif
 
 /* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
 #      define Q_NO_TEMPLATE_FRIENDS
 #    endif
 #    if !defined(_BOOL)
-#      define Q_NO_BOOL_TYPE
+#      error "Compiler not supported"
 #    endif
 #    if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
 #      define Q_NO_USING_KEYWORD
 #    define Q_C_CALLBACKS
 /* 4.2 compiler or older */
 #  else
-#    define Q_NO_BOOL_TYPE
-#    define Q_NO_EXPLICIT_KEYWORD
-#    define Q_NO_USING_KEYWORD
+#    error "Compiler not supported"
 #  endif
 
 /* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
 #  define Q_CC_EDG
 #  define Q_CC_CDS
 #  if !defined(_BOOL)
-#    define Q_NO_BOOL_TYPE
+#    error "Compiler not supported"
 #  endif
 #  define Q_BROKEN_TEMPLATE_SPECIALIZATION
 
 #      define Q_DECL_IMPORT     Q_DECL_EXPORT
 #    endif
 #  else
-#    define Q_CC_HP
-#    define Q_NO_BOOL_TYPE
-#    define Q_FULL_TEMPLATE_INSTANTIATION
-#    define Q_BROKEN_TEMPLATE_SPECIALIZATION
-#    define Q_NO_EXPLICIT_KEYWORD
+#    error "Compiler not supported"
 #  endif
 #  define Q_NO_USING_KEYWORD /* ### check "using" status */
 
index 1fb5778..58bdf06 100644 (file)
@@ -275,11 +275,6 @@ typedef unsigned int uint;
 typedef unsigned long ulong;
 QT_END_INCLUDE_NAMESPACE
 
-#if defined(Q_NO_BOOL_TYPE)
-#error "Compiler doesn't support the bool type"
-#endif
-
-
 /*
    Constant bool values
 */