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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 | 226 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 |
233 #define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__ | 227 #define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__ |
234 #elif COMPILER(MSVC) | 228 #elif COMPILER(MSVC) |
235 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 | 229 #define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 |
236 #define WTF_PRETTY_FUNCTION __FUNCSIG__ | 230 #define WTF_PRETTY_FUNCTION __FUNCSIG__ |
237 #else | 231 #else |
238 #define WTF_PRETTY_FUNCTION __FUNCTION__ | 232 #define WTF_PRETTY_FUNCTION __FUNCTION__ |
239 #endif | 233 #endif |
240 | 234 |
241 #endif /* WTF_Compiler_h */ | 235 #endif /* WTF_Compiler_h */ |
OLD | NEW |