summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qcompilerdetection.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-03-28 16:00:59 -0300
committerQt by Nokia <qt-info@nokia.com>2012-04-21 05:09:18 +0200
commit32758d917e3a7fd0d2e344d89d9ccaf0361326d8 (patch)
tree117d2a89cc078d6d41627c8e7dbabc19bb7d65ba /src/corelib/global/qcompilerdetection.h
parent308ffceea5fcb6896da5a791f153cc772d42c810 (diff)
Move some compiler macro definitions into the compiler sections
Makes for a couple of cleaner definitions of fallbacks. Change-Id: I9b1a6f77bab986514e1862ae1f431ea37b89c1b5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/global/qcompilerdetection.h')
-rw-r--r--src/corelib/global/qcompilerdetection.h38
1 files changed, 12 insertions, 26 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index cea26e0971..d6267b52b3 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -86,13 +86,16 @@
# define Q_CC_MSVC_NET
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_NO_TEMPLATE_FRIENDS
+# define Q_COMPILER_MANGLES_RETURN_TYPE
# define Q_ALIGNOF(type) __alignof(type)
# define Q_DECL_ALIGN(n) __declspec(align(n))
# define Q_ASSUME(expr) __assume(expr)
# define Q_UNREACHABLE() __assume(0)
# define Q_NORETURN __declspec(noreturn)
+# define Q_DECL_DEPRECATED __declspec(deprecated)
/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
# if defined(__INTEL_COMPILER)
+# define Q_DECL_VARIABLE_DEPRECATED
# define Q_CC_INTEL
# endif
/* MSVC does not support SSE/MMX on x64 */
@@ -139,6 +142,7 @@
/* work-around for missing compiler intrinsics */
# define __is_empty(X) false
# define __is_pod(X) false
+# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(__GNUC__)
# define Q_CC_GNU
# define Q_C_CALLBACKS
@@ -165,10 +169,12 @@
# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
+# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
# define Q_NORETURN __attribute__((__noreturn__))
+# define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
# if !defined(QT_MOC_CPP)
# define Q_PACKED __attribute__ ((__packed__))
# define Q_NO_PACKED_REFERENCE
@@ -635,16 +641,13 @@
# define Q_ALLOC_SIZE(x)
#endif
#ifndef Q_REQUIRED_RESULT
-# if defined(Q_CC_GNU)
-# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
-# else
-# define Q_REQUIRED_RESULT
-# endif
+# define Q_REQUIRED_RESULT
#endif
-#ifndef Q_COMPILER_MANGLES_RETURN_TYPE
-# if defined(Q_CC_MSVC)
-# define Q_COMPILER_MANGLES_RETURN_TYPE
-# endif
+#ifndef Q_DECL_DEPRECATED
+# define Q_DECL_DEPRECATED
+#endif
+#ifndef Q_DECL_VARIABLE_DEPRECATED
+# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
#endif
/*
@@ -660,23 +663,6 @@
#endif
/*
- Warnings and errors when using deprecated methods
-*/
-#if defined(Q_CC_GNU) || defined(Q_CC_RVCT)
-# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
-#elif defined(Q_CC_MSVC)
-# define Q_DECL_DEPRECATED __declspec(deprecated)
-# if defined (Q_CC_INTEL)
-# define Q_DECL_VARIABLE_DEPRECATED
-# endif
-#else
-# define Q_DECL_DEPRECATED
-#endif
-#ifndef Q_DECL_VARIABLE_DEPRECATED
-# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
-#endif
-
-/*
Proper for-scoping in MIPSpro CC
*/
#ifndef QT_NO_KEYWORDS