OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 /* There is a bug in clang that comes with Xcode 4.2 where AtomicStrings can't b
e implicitly converted to Strings | 48 /* There is a bug in clang that comes with Xcode 4.2 where AtomicStrings can't b
e implicitly converted to Strings |
49 in the presence of move constructors and/or move assignment operators. This b
ug has been fixed in Xcode 4.3 clang, so we | 49 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 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 */ | 50 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 #define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES __has_extension(cxx_rvalue_r
eferences) && __has_extension(cxx_nonstatic_member_init) | 51 #define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES __has_extension(cxx_rvalue_r
eferences) && __has_extension(cxx_nonstatic_member_init) |
52 | 52 |
53 #define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS __has_extension(cxx_deleted_
functions) | 53 #define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS __has_extension(cxx_deleted_
functions) |
54 #define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS __has_feature(cxx_explici
t_conversions) | 54 #define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS __has_feature(cxx_explici
t_conversions) |
55 #define WTF_COMPILER_SUPPORTS_BLOCKS __has_feature(blocks) | 55 #define WTF_COMPILER_SUPPORTS_BLOCKS __has_feature(blocks) |
56 #define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT __has_extension(c_static_assert) | 56 #define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT __has_extension(c_static_assert) |
57 #define WTF_COMPILER_SUPPORTS_CXX_STATIC_ASSERT __has_extension(cxx_static_asser
t) | 57 #define WTF_COMPILER_SUPPORTS_CXX_STATIC_ASSERT __has_extension(cxx_static_asser
t) |
58 #define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL __has_extension(cxx_override_
control) | |
59 #define WTF_COMPILER_SUPPORTS_HAS_TRIVIAL_DESTRUCTOR __has_extension(has_trivial
_destructor) | 58 #define WTF_COMPILER_SUPPORTS_HAS_TRIVIAL_DESTRUCTOR __has_extension(has_trivial
_destructor) |
60 #define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS __has_extension(cxx_strong_enums) | 59 #define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS __has_extension(cxx_strong_enums) |
61 | 60 |
62 #endif | 61 #endif |
63 | 62 |
64 #ifndef CLANG_PRAGMA | 63 #ifndef CLANG_PRAGMA |
65 #define CLANG_PRAGMA(PRAGMA) | 64 #define CLANG_PRAGMA(PRAGMA) |
66 #endif | 65 #endif |
67 | 66 |
68 /* COMPILER(MSVC) - Microsoft Visual C++ */ | 67 /* COMPILER(MSVC) - Microsoft Visual C++ */ |
69 #if defined(_MSC_VER) | 68 #if defined(_MSC_VER) |
70 #define WTF_COMPILER_MSVC 1 | 69 #define WTF_COMPILER_MSVC 1 |
71 | 70 |
72 /* Specific compiler features */ | 71 /* Specific compiler features */ |
73 #if COMPILER(CLANG) | 72 #if COMPILER(CLANG) |
74 /* Keep strong enums turned off when building with clang-cl: We cannot yet build
all of Blink without fallback to cl.exe, and strong enums are exposed at ABI bo
undaries. */ | 73 /* Keep strong enums turned off when building with clang-cl: We cannot yet build
all of Blink without fallback to cl.exe, and strong enums are exposed at ABI bo
undaries. */ |
75 #undef WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS | 74 #undef WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS |
76 #else | |
77 #define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1 | |
78 #endif | 75 #endif |
79 | 76 |
80 #endif | 77 #endif |
81 | 78 |
82 /* COMPILER(GCC) - GNU Compiler Collection */ | 79 /* COMPILER(GCC) - GNU Compiler Collection */ |
83 #if defined(__GNUC__) | 80 #if defined(__GNUC__) |
84 #define WTF_COMPILER_GCC 1 | 81 #define WTF_COMPILER_GCC 1 |
85 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL
__) | 82 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL
__) |
86 #define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000
+ minor * 100 + patch)) | 83 #define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000
+ minor * 100 + patch)) |
87 #else | 84 #else |
(...skipping 16 matching lines...) Expand all Loading... |
104 #if GCC_VERSION_AT_LEAST(4, 4, 0) | 101 #if GCC_VERSION_AT_LEAST(4, 4, 0) |
105 #define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS 1 | 102 #define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS 1 |
106 #endif | 103 #endif |
107 #if GCC_VERSION_AT_LEAST(4, 5, 0) | 104 #if GCC_VERSION_AT_LEAST(4, 5, 0) |
108 #define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS 1 | 105 #define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS 1 |
109 #endif | 106 #endif |
110 #if GCC_VERSION_AT_LEAST(4, 6, 0) | 107 #if GCC_VERSION_AT_LEAST(4, 6, 0) |
111 /* Strong enums should work from gcc 4.4, but doesn't seem to support some opera
tors */ | 108 /* Strong enums should work from gcc 4.4, but doesn't seem to support some opera
tors */ |
112 #define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS 1 | 109 #define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS 1 |
113 #endif | 110 #endif |
114 #if GCC_VERSION_AT_LEAST(4, 7, 0) | |
115 #define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1 | |
116 #endif | |
117 #endif /* defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplu
splus >= 201103L) */ | 111 #endif /* defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplu
splus >= 201103L) */ |
118 #endif /* COMPILER(GCC) */ | 112 #endif /* COMPILER(GCC) */ |
119 | 113 |
120 /* ==== Compiler features ==== */ | 114 /* ==== Compiler features ==== */ |
121 | 115 |
122 | 116 |
123 /* ALWAYS_INLINE */ | 117 /* ALWAYS_INLINE */ |
124 | 118 |
125 #ifndef ALWAYS_INLINE | 119 #ifndef ALWAYS_INLINE |
126 #if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW) | 120 #if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 #else | 182 #else |
189 #define WARN_UNUSED_RETURN | 183 #define WARN_UNUSED_RETURN |
190 #endif | 184 #endif |
191 | 185 |
192 | 186 |
193 /* ALLOW_UNUSED_LOCAL */ | 187 /* ALLOW_UNUSED_LOCAL */ |
194 | 188 |
195 #define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0 | 189 #define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0 |
196 | 190 |
197 | 191 |
198 /* OVERRIDE and FINAL */ | |
199 | |
200 #if COMPILER_SUPPORTS(CXX_OVERRIDE_CONTROL) | |
201 #define OVERRIDE override | |
202 #define FINAL final | |
203 #else | |
204 #define OVERRIDE | |
205 #define FINAL | |
206 #endif | |
207 | |
208 | |
209 /* WTF_DELETED_FUNCTION */ | 192 /* WTF_DELETED_FUNCTION */ |
210 | 193 |
211 #if COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS) | 194 #if COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS) |
212 #define WTF_DELETED_FUNCTION = delete | 195 #define WTF_DELETED_FUNCTION = delete |
213 #else | 196 #else |
214 #define WTF_DELETED_FUNCTION | 197 #define WTF_DELETED_FUNCTION |
215 #endif | 198 #endif |
216 | 199 |
217 | 200 |
218 /* REFERENCED_FROM_ASM */ | 201 /* REFERENCED_FROM_ASM */ |
(...skipping 24 matching lines...) Expand all Loading... |
243 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 | 226 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 |
244 #define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__ | 227 #define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__ |
245 #elif COMPILER(MSVC) | 228 #elif COMPILER(MSVC) |
246 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 | 229 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 |
247 #define WTF_PRETTY_FUNCTION __FUNCSIG__ | 230 #define WTF_PRETTY_FUNCTION __FUNCSIG__ |
248 #else | 231 #else |
249 #define WTF_PRETTY_FUNCTION __FUNCTION__ | 232 #define WTF_PRETTY_FUNCTION __FUNCTION__ |
250 #endif | 233 #endif |
251 | 234 |
252 #endif /* WTF_Compiler_h */ | 235 #endif /* WTF_Compiler_h */ |
OLD | NEW |