Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: Source/wtf/Compiler.h

Issue 14734009: More Compiler.h cleanups. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/wtf/Assertions.h ('k') | Source/wtf/UnusedParam.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 23 matching lines...) Expand all
34 34
35 /* COMPILER_QUIRK() - whether the compiler being used to build the project requi res a given quirk. */ 35 /* COMPILER_QUIRK() - whether the compiler being used to build the project requi res a given quirk. */
36 #define COMPILER_QUIRK(WTF_COMPILER_QUIRK) (defined WTF_COMPILER_QUIRK_##WTF_COM PILER_QUIRK && WTF_COMPILER_QUIRK_##WTF_COMPILER_QUIRK) 36 #define COMPILER_QUIRK(WTF_COMPILER_QUIRK) (defined WTF_COMPILER_QUIRK_##WTF_COM PILER_QUIRK && WTF_COMPILER_QUIRK_##WTF_COMPILER_QUIRK)
37 37
38 /* ==== COMPILER() - the compiler being used to build the project ==== */ 38 /* ==== COMPILER() - the compiler being used to build the project ==== */
39 39
40 /* COMPILER(CLANG) - Clang */ 40 /* COMPILER(CLANG) - Clang */
41 #if defined(__clang__) 41 #if defined(__clang__)
42 #define WTF_COMPILER_CLANG 1 42 #define WTF_COMPILER_CLANG 1
43 43
44 #ifndef __has_extension
45 #define __has_extension __has_feature /* Compatibility with older versions of cl ang */
46 #endif
47
48 #define CLANG_PRAGMA(PRAGMA) _Pragma(PRAGMA) 44 #define CLANG_PRAGMA(PRAGMA) _Pragma(PRAGMA)
49 45
50 /* Specific compiler features */ 46 /* Specific compiler features */
51 #define WTF_COMPILER_SUPPORTS_CXX_VARIADIC_TEMPLATES __has_extension(cxx_variadi c_templates) 47 #define WTF_COMPILER_SUPPORTS_CXX_VARIADIC_TEMPLATES __has_extension(cxx_variadi c_templates)
52 48
53 /* There is a bug in clang that comes with Xcode 4.2 where AtomicStrings can't b e implicitly converted to Strings 49 /* There is a bug in clang that comes with Xcode 4.2 where AtomicStrings can't b e implicitly converted to Strings
54 in the presence of move constructors and/or move assignment operators. This b ug has been fixed in Xcode 4.3 clang, so we 50 in the presence of move constructors and/or move assignment operators. This b ug has been fixed in Xcode 4.3 clang, so we
55 check for both cxx_rvalue_references as well as the unrelated cxx_nonstatic_m ember_init feature which we know was added in 4.3 */ 51 check for both cxx_rvalue_references as well as the unrelated cxx_nonstatic_m ember_init feature which we know was added in 4.3 */
56 #define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES __has_extension(cxx_rvalue_r eferences) && __has_extension(cxx_nonstatic_member_init) 52 #define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES __has_extension(cxx_rvalue_r eferences) && __has_extension(cxx_nonstatic_member_init)
57 53
(...skipping 22 matching lines...) Expand all
80 #define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1 76 #define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1
81 #endif 77 #endif
82 78
83 #if !COMPILER(CLANG) 79 #if !COMPILER(CLANG)
84 #define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1 80 #define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1
85 #define WTF_COMPILER_QUIRK_FINAL_IS_CALLED_SEALED 1 81 #define WTF_COMPILER_QUIRK_FINAL_IS_CALLED_SEALED 1
86 #endif 82 #endif
87 83
88 #endif 84 #endif
89 85
90 /* COMPILER(GCCE) - GNU Compiler Collection for Embedded */
91 #if defined(__GCCE__)
92 #define WTF_COMPILER_GCCE 1
93 #define GCCE_VERSION (__GCCE__ * 10000 + __GCCE_MINOR__ * 100 + __GCCE_PATCHLEVE L__)
94 #define GCCE_VERSION_AT_LEAST(major, minor, patch) (GCCE_VERSION >= (major * 100 00 + minor * 100 + patch))
95 #endif
96
97 /* COMPILER(GCC) - GNU Compiler Collection */ 86 /* COMPILER(GCC) - GNU Compiler Collection */
98 #if defined(__GNUC__) 87 #if defined(__GNUC__)
99 #define WTF_COMPILER_GCC 1 88 #define WTF_COMPILER_GCC 1
100 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL __) 89 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL __)
101 #define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch)) 90 #define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
102 #else 91 #else
103 /* Define this for !GCC compilers, just so we can write things like GCC_VERSION_ AT_LEAST(4, 1, 0). */ 92 /* Define this for !GCC compilers, just so we can write things like GCC_VERSION_ AT_LEAST(4, 1, 0). */
104 #define GCC_VERSION_AT_LEAST(major, minor, patch) 0 93 #define GCC_VERSION_AT_LEAST(major, minor, patch) 0
105 #endif 94 #endif
106 95
(...skipping 30 matching lines...) Expand all
137 /* COMPILER(MINGW) - MinGW GCC */ 126 /* COMPILER(MINGW) - MinGW GCC */
138 /* COMPILER(MINGW64) - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */ 127 /* COMPILER(MINGW64) - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */
139 #if defined(__MINGW32__) 128 #if defined(__MINGW32__)
140 #define WTF_COMPILER_MINGW 1 129 #define WTF_COMPILER_MINGW 1
141 #include <_mingw.h> /* private MinGW header */ 130 #include <_mingw.h> /* private MinGW header */
142 #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs m ingw.org */ 131 #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs m ingw.org */
143 #define WTF_COMPILER_MINGW64 1 132 #define WTF_COMPILER_MINGW64 1
144 #endif /* __MINGW64_VERSION_MAJOR */ 133 #endif /* __MINGW64_VERSION_MAJOR */
145 #endif /* __MINGW32__ */ 134 #endif /* __MINGW32__ */
146 135
147 /* COMPILER(INTEL) - Intel C++ Compiler */
148 #if defined(__INTEL_COMPILER)
149 #define WTF_COMPILER_INTEL 1
150 #endif
151
152 /* ==== Compiler features ==== */ 136 /* ==== Compiler features ==== */
153 137
154 138
155 /* ALWAYS_INLINE */ 139 /* ALWAYS_INLINE */
156 140
157 #ifndef ALWAYS_INLINE 141 #ifndef ALWAYS_INLINE
158 #if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW) 142 #if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW)
159 #define ALWAYS_INLINE inline __attribute__((__always_inline__)) 143 #define ALWAYS_INLINE inline __attribute__((__always_inline__))
160 #elif COMPILER(MSVC) && defined(NDEBUG) 144 #elif COMPILER(MSVC) && defined(NDEBUG)
161 #define ALWAYS_INLINE __forceinline 145 #define ALWAYS_INLINE __forceinline
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 #define OBJC_CLASS class 250 #define OBJC_CLASS class
267 #endif 251 #endif
268 #endif 252 #endif
269 253
270 /* ABI */ 254 /* ABI */
271 #if defined(__ARM_EABI__) || defined(__EABI__) 255 #if defined(__ARM_EABI__) || defined(__EABI__)
272 #define WTF_COMPILER_SUPPORTS_EABI 1 256 #define WTF_COMPILER_SUPPORTS_EABI 1
273 #endif 257 #endif
274 258
275 #endif /* WTF_Compiler_h */ 259 #endif /* WTF_Compiler_h */
OLDNEW
« no previous file with comments | « Source/wtf/Assertions.h ('k') | Source/wtf/UnusedParam.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698