OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_BASE_COMPILER_SPECIFIC_H_ | 5 #ifndef V8_BASE_COMPILER_SPECIFIC_H_ |
6 #define V8_BASE_COMPILER_SPECIFIC_H_ | 6 #define V8_BASE_COMPILER_SPECIFIC_H_ |
7 | 7 |
8 #include "include/v8config.h" | 8 #include "include/v8config.h" |
9 | 9 |
10 // Annotate a typedef or function indicating it's ok if it's not used. | 10 // Annotate a typedef or function indicating it's ok if it's not used. |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // Annotate a virtual method indicating that subclasses must not override it, | 31 // Annotate a virtual method indicating that subclasses must not override it, |
32 // or annotate a class to indicate that it cannot be subclassed. | 32 // or annotate a class to indicate that it cannot be subclassed. |
33 // Use like: | 33 // Use like: |
34 // class B FINAL : public A {}; | 34 // class B FINAL : public A {}; |
35 // virtual void bar() FINAL; | 35 // virtual void bar() FINAL; |
36 #if V8_HAS_CXX11_FINAL | 36 #if V8_HAS_CXX11_FINAL |
37 #define FINAL final | 37 #define FINAL final |
38 #elif V8_HAS___FINAL | 38 #elif V8_HAS___FINAL |
39 #define FINAL __final | 39 #define FINAL __final |
40 #elif V8_HAS_SEALED | |
41 #define FINAL sealed | |
42 #else | 40 #else |
43 #define FINAL /* NOT SUPPORTED */ | 41 #define FINAL /* NOT SUPPORTED */ |
44 #endif | 42 #endif |
45 | 43 |
46 | 44 |
47 // Annotate a function indicating the caller must examine the return value. | 45 // Annotate a function indicating the caller must examine the return value. |
48 // Use like: | 46 // Use like: |
49 // int foo() WARN_UNUSED_RESULT; | 47 // int foo() WARN_UNUSED_RESULT; |
50 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 48 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
51 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 49 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
52 #else | 50 #else |
53 #define WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 51 #define WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
54 #endif | 52 #endif |
55 | 53 |
56 #endif // V8_BASE_COMPILER_SPECIFIC_H_ | 54 #endif // V8_BASE_COMPILER_SPECIFIC_H_ |
OLD | NEW |