OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64) | 238 # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64) |
239 | 239 |
240 # define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0)) | 240 # define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0)) |
241 | 241 |
242 # define V8_HAS_ATTRIBUTE_ALIGNED (V8_GNUC_PREREQ(2, 95, 0)) | 242 # define V8_HAS_ATTRIBUTE_ALIGNED (V8_GNUC_PREREQ(2, 95, 0)) |
243 // always_inline is available in gcc 4.0 but not very reliable until 4.4. | 243 // always_inline is available in gcc 4.0 but not very reliable until 4.4. |
244 // Works around "sorry, unimplemented: inlining failed" build errors with | 244 // Works around "sorry, unimplemented: inlining failed" build errors with |
245 // older compilers. | 245 // older compilers. |
246 # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (V8_GNUC_PREREQ(4, 4, 0)) | 246 # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (V8_GNUC_PREREQ(4, 4, 0)) |
247 # define V8_HAS_ATTRIBUTE_DEPRECATED (V8_GNUC_PREREQ(3, 4, 0)) | 247 # define V8_HAS_ATTRIBUTE_DEPRECATED (V8_GNUC_PREREQ(3, 4, 0)) |
| 248 # define V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE (V8_GNUC_PREREQ(4, 5, 0)) |
248 # define V8_HAS_ATTRIBUTE_NOINLINE (V8_GNUC_PREREQ(3, 4, 0)) | 249 # define V8_HAS_ATTRIBUTE_NOINLINE (V8_GNUC_PREREQ(3, 4, 0)) |
249 # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) | 250 # define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0)) |
250 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ | 251 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ |
251 (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) | 252 (!V8_CC_INTEL && V8_GNUC_PREREQ(4, 1, 0)) |
252 | 253 |
253 # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) | 254 # define V8_HAS_BUILTIN_EXPECT (V8_GNUC_PREREQ(2, 96, 0)) |
254 | 255 |
255 // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality | 256 // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality |
256 // without warnings (functionality used by the macros below). These modes | 257 // without warnings (functionality used by the macros below). These modes |
257 // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, | 258 // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE | 314 #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE |
314 # define V8_NOINLINE __attribute__((noinline)) | 315 # define V8_NOINLINE __attribute__((noinline)) |
315 #elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE | 316 #elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE |
316 # define V8_NOINLINE __declspec(noinline) | 317 # define V8_NOINLINE __declspec(noinline) |
317 #else | 318 #else |
318 # define V8_NOINLINE /* NOT SUPPORTED */ | 319 # define V8_NOINLINE /* NOT SUPPORTED */ |
319 #endif | 320 #endif |
320 | 321 |
321 | 322 |
322 // A macro to mark classes or functions as deprecated. | 323 // A macro to mark classes or functions as deprecated. |
323 #if !V8_DISABLE_DEPRECATIONS && V8_HAS_ATTRIBUTE_DEPRECATED | 324 #if defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE |
324 # define V8_DEPRECATED(declarator) declarator __attribute__((deprecated)) | 325 # define V8_DEPRECATED(message, declarator) \ |
325 #elif !V8_DISABLE_DEPRECATIONS && V8_HAS_DECLSPEC_DEPRECATED | 326 declarator __attribute__((deprecated(message))) |
326 # define V8_DEPRECATED(declarator) __declspec(deprecated) declarator | 327 #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED |
| 328 # define V8_DEPRECATED(message, declarator) \ |
| 329 declarator __attribute__((deprecated)) |
| 330 #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED |
| 331 # define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarator |
327 #else | 332 #else |
328 # define V8_DEPRECATED(declarator) declarator | 333 # define V8_DEPRECATED(message, declarator) declarator |
329 #endif | 334 #endif |
330 | 335 |
331 | 336 |
332 // Annotate a function indicating the caller must examine the return value. | 337 // Annotate a function indicating the caller must examine the return value. |
333 // Use like: | 338 // Use like: |
334 // int foo() V8_WARN_UNUSED_RESULT; | 339 // int foo() V8_WARN_UNUSED_RESULT; |
335 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 340 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
336 # define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 341 # define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
337 #else | 342 #else |
338 # define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 343 # define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 # define V8_ALIGNOF(type) __alignof__(type) | 447 # define V8_ALIGNOF(type) __alignof__(type) |
443 #else | 448 #else |
444 // Note that alignment of a type within a struct can be less than the | 449 // Note that alignment of a type within a struct can be less than the |
445 // alignment of the type stand-alone (because of ancient ABIs), so this | 450 // alignment of the type stand-alone (because of ancient ABIs), so this |
446 // should only be used as a last resort. | 451 // should only be used as a last resort. |
447 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } | 452 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } |
448 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) | 453 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) |
449 #endif | 454 #endif |
450 | 455 |
451 #endif // V8CONFIG_H_ | 456 #endif // V8CONFIG_H_ |
OLD | NEW |