Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 V8CONFIG_H_ | 5 #ifndef V8CONFIG_H_ |
| 6 #define V8CONFIG_H_ | 6 #define V8CONFIG_H_ |
| 7 | 7 |
| 8 // Platform headers for feature detection below. | 8 // Platform headers for feature detection below. |
| 9 #if defined(__ANDROID__) | 9 #if defined(__ANDROID__) |
| 10 # include <sys/cdefs.h> | 10 # include <sys/cdefs.h> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 #endif | 113 #endif |
| 114 | 114 |
| 115 | 115 |
| 116 // ----------------------------------------------------------------------------- | 116 // ----------------------------------------------------------------------------- |
| 117 // C library detection | 117 // C library detection |
| 118 // | 118 // |
| 119 // V8_LIBC_MSVCRT - MSVC libc | 119 // V8_LIBC_MSVCRT - MSVC libc |
| 120 // V8_LIBC_BIONIC - Bionic libc | 120 // V8_LIBC_BIONIC - Bionic libc |
| 121 // V8_LIBC_BSD - BSD libc derivate | 121 // V8_LIBC_BSD - BSD libc derivate |
| 122 // V8_LIBC_GLIBC - GNU C library | 122 // V8_LIBC_GLIBC - GNU C library |
| 123 // V8_LIBC_UCLIBC - uClibc | |
|
Benedikt Meurer
2014/10/22 06:15:07
This was unused and crappy, so I removed that on t
| |
| 124 // | 123 // |
| 125 // Note that testing for libc must be done using #if not #ifdef. For example, | 124 // Note that testing for libc must be done using #if not #ifdef. For example, |
| 126 // to test for the GNU C library, use: | 125 // to test for the GNU C library, use: |
| 127 // #if V8_LIBC_GLIBC | 126 // #if V8_LIBC_GLIBC |
| 128 // ... | 127 // ... |
| 129 // #endif | 128 // #endif |
| 130 | 129 |
| 131 #if defined (_MSC_VER) | 130 #if defined (_MSC_VER) |
| 132 # define V8_LIBC_MSVCRT 1 | 131 # define V8_LIBC_MSVCRT 1 |
| 133 #elif defined(__BIONIC__) | 132 #elif defined(__BIONIC__) |
| 134 # define V8_LIBC_BIONIC 1 | 133 # define V8_LIBC_BIONIC 1 |
| 135 # define V8_LIBC_BSD 1 | 134 # define V8_LIBC_BSD 1 |
| 136 #elif defined(__UCLIBC__) | |
| 137 # define V8_LIBC_UCLIBC 1 | |
| 138 #elif defined(__GLIBC__) || defined(__GNU_LIBRARY__) | 135 #elif defined(__GLIBC__) || defined(__GNU_LIBRARY__) |
| 139 # define V8_LIBC_GLIBC 1 | 136 # define V8_LIBC_GLIBC 1 |
| 140 #else | 137 #else |
| 141 # define V8_LIBC_BSD V8_OS_BSD | 138 # define V8_LIBC_BSD V8_OS_BSD |
| 142 #endif | 139 #endif |
| 143 | 140 |
| 144 | 141 |
| 145 // ----------------------------------------------------------------------------- | 142 // ----------------------------------------------------------------------------- |
| 146 // Compiler detection | 143 // Compiler detection |
| 147 // | 144 // |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 # define V8_ALIGNOF(type) __alignof__(type) | 406 # define V8_ALIGNOF(type) __alignof__(type) |
| 410 #else | 407 #else |
| 411 // Note that alignment of a type within a struct can be less than the | 408 // Note that alignment of a type within a struct can be less than the |
| 412 // alignment of the type stand-alone (because of ancient ABIs), so this | 409 // alignment of the type stand-alone (because of ancient ABIs), so this |
| 413 // should only be used as a last resort. | 410 // should only be used as a last resort. |
| 414 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } | 411 namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; } |
| 415 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) | 412 # define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type)) |
| 416 #endif | 413 #endif |
| 417 | 414 |
| 418 #endif // V8CONFIG_H_ | 415 #endif // V8CONFIG_H_ |
| OLD | NEW |