OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 25 matching lines...) Expand all Loading... |
36 */ | 36 */ |
37 | 37 |
38 #ifndef V8_H_ | 38 #ifndef V8_H_ |
39 #define V8_H_ | 39 #define V8_H_ |
40 | 40 |
41 #include "v8stdint.h" | 41 #include "v8stdint.h" |
42 | 42 |
43 // We reserve the V8_* prefix for macros defined in V8 public API and | 43 // We reserve the V8_* prefix for macros defined in V8 public API and |
44 // assume there are no name conflicts with the embedder's code. | 44 // assume there are no name conflicts with the embedder's code. |
45 | 45 |
46 #ifdef _WIN32 | 46 #ifdef V8_OS_WIN |
47 | 47 |
48 // Setup for Windows DLL export/import. When building the V8 DLL the | 48 // Setup for Windows DLL export/import. When building the V8 DLL the |
49 // BUILDING_V8_SHARED needs to be defined. When building a program which uses | 49 // BUILDING_V8_SHARED needs to be defined. When building a program which uses |
50 // the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8 | 50 // the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8 |
51 // static library or building a program which uses the V8 static library neither | 51 // static library or building a program which uses the V8 static library neither |
52 // BUILDING_V8_SHARED nor USING_V8_SHARED should be defined. | 52 // BUILDING_V8_SHARED nor USING_V8_SHARED should be defined. |
53 #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) | 53 #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) |
54 #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ | 54 #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ |
55 build configuration to ensure that at most one of these is set | 55 build configuration to ensure that at most one of these is set |
56 #endif | 56 #endif |
57 | 57 |
58 #ifdef BUILDING_V8_SHARED | 58 #ifdef BUILDING_V8_SHARED |
59 #define V8_EXPORT __declspec(dllexport) | 59 # define V8_EXPORT __declspec(dllexport) |
60 #elif USING_V8_SHARED | 60 #elif USING_V8_SHARED |
61 #define V8_EXPORT __declspec(dllimport) | 61 # define V8_EXPORT __declspec(dllimport) |
62 #else | 62 #else |
63 #define V8_EXPORT | 63 # define V8_EXPORT |
64 #endif // BUILDING_V8_SHARED | 64 #endif // BUILDING_V8_SHARED |
65 | 65 |
66 #else // _WIN32 | 66 #else // V8_OS_WIN |
67 | 67 |
68 // Setup for Linux shared library export. | 68 // Setup for Linux shared library export. |
69 #if defined(__GNUC__) && ((__GNUC__ >= 4) || \ | 69 #if V8_HAS_ATTRIBUTE_VISIBILITY && defined(V8_SHARED) |
70 (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED) | 70 # ifdef BUILDING_V8_SHARED |
71 #ifdef BUILDING_V8_SHARED | 71 # define V8_EXPORT __attribute__ ((visibility("default"))) |
72 #define V8_EXPORT __attribute__ ((visibility("default"))) | 72 # else |
| 73 # define V8_EXPORT |
| 74 # endif |
73 #else | 75 #else |
74 #define V8_EXPORT | 76 # define V8_EXPORT |
75 #endif | |
76 #else | |
77 #define V8_EXPORT | |
78 #endif | 77 #endif |
79 | 78 |
80 #endif // _WIN32 | 79 #endif // V8_OS_WIN |
81 | |
82 #if defined(__GNUC__) && !defined(DEBUG) | |
83 #define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator | |
84 #elif defined(_MSC_VER) && !defined(DEBUG) | |
85 #define V8_INLINE(declarator) __forceinline declarator | |
86 #else | |
87 #define V8_INLINE(declarator) inline declarator | |
88 #endif | |
89 | |
90 #if defined(__GNUC__) && !V8_DISABLE_DEPRECATIONS | |
91 #define V8_DEPRECATED(declarator) declarator __attribute__ ((deprecated)) | |
92 #elif defined(_MSC_VER) && !V8_DISABLE_DEPRECATIONS | |
93 #define V8_DEPRECATED(declarator) __declspec(deprecated) declarator | |
94 #else | |
95 #define V8_DEPRECATED(declarator) declarator | |
96 #endif | |
97 | |
98 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) | |
99 #define V8_UNLIKELY(condition) __builtin_expect((condition), 0) | |
100 #define V8_LIKELY(condition) __builtin_expect((condition), 1) | |
101 #else | |
102 #define V8_UNLIKELY(condition) (condition) | |
103 #define V8_LIKELY(condition) (condition) | |
104 #endif | |
105 | 80 |
106 /** | 81 /** |
107 * The v8 JavaScript engine. | 82 * The v8 JavaScript engine. |
108 */ | 83 */ |
109 namespace v8 { | 84 namespace v8 { |
110 | 85 |
111 class AccessorInfo; | 86 class AccessorInfo; |
112 class AccessorSignature; | 87 class AccessorSignature; |
113 class Array; | 88 class Array; |
114 class Boolean; | 89 class Boolean; |
(...skipping 6487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6602 */ | 6577 */ |
6603 | 6578 |
6604 | 6579 |
6605 } // namespace v8 | 6580 } // namespace v8 |
6606 | 6581 |
6607 | 6582 |
6608 #undef TYPE_CHECK | 6583 #undef TYPE_CHECK |
6609 | 6584 |
6610 | 6585 |
6611 #endif // V8_H_ | 6586 #endif // V8_H_ |
OLD | NEW |