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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 | 119 |
| 120 // ----------------------------------------------------------------------------- | 120 // ----------------------------------------------------------------------------- |
| 121 // C library detection | 121 // C library detection |
| 122 // | 122 // |
| 123 // V8_LIBC_MSVCRT - MSVC libc | 123 // V8_LIBC_MSVCRT - MSVC libc |
| 124 // V8_LIBC_BIONIC - Bionic libc | 124 // V8_LIBC_BIONIC - Bionic libc |
| 125 // V8_LIBC_BSD - BSD libc derivate | 125 // V8_LIBC_BSD - BSD libc derivate |
| 126 // V8_LIBC_GLIBC - GNU C library | 126 // V8_LIBC_GLIBC - GNU C library |
| 127 // V8_LIBC_UCLIBC - uClibc | |
|
smcgruer2
2015/04/13 16:41:25
I'm on the fence about reintroducing this, as it's
| |
| 127 // | 128 // |
| 128 // Note that testing for libc must be done using #if not #ifdef. For example, | 129 // Note that testing for libc must be done using #if not #ifdef. For example, |
| 129 // to test for the GNU C library, use: | 130 // to test for the GNU C library, use: |
| 130 // #if V8_LIBC_GLIBC | 131 // #if V8_LIBC_GLIBC |
| 131 // ... | 132 // ... |
| 132 // #endif | 133 // #endif |
| 133 | 134 |
| 134 #if defined (_MSC_VER) | 135 #if defined (_MSC_VER) |
| 135 # define V8_LIBC_MSVCRT 1 | 136 # define V8_LIBC_MSVCRT 1 |
| 136 #elif defined(__BIONIC__) | 137 #elif defined(__BIONIC__) |
| 137 # define V8_LIBC_BIONIC 1 | 138 # define V8_LIBC_BIONIC 1 |
| 138 # define V8_LIBC_BSD 1 | 139 # define V8_LIBC_BSD 1 |
| 140 #elif defined(__UCLIBC__) | |
| 141 // Must test for UCLIBC before GLIBC, as UCLIBC pretends to be GLIBC. | |
| 142 # define V8_LIBC_UCLIBC 1 | |
| 139 #elif defined(__GLIBC__) || defined(__GNU_LIBRARY__) | 143 #elif defined(__GLIBC__) || defined(__GNU_LIBRARY__) |
| 140 # define V8_LIBC_GLIBC 1 | 144 # define V8_LIBC_GLIBC 1 |
| 141 #else | 145 #else |
| 142 # define V8_LIBC_BSD V8_OS_BSD | 146 # define V8_LIBC_BSD V8_OS_BSD |
| 143 #endif | 147 #endif |
| 144 | 148 |
| 145 | 149 |
| 146 // ----------------------------------------------------------------------------- | 150 // ----------------------------------------------------------------------------- |
| 147 // Compiler detection | 151 // Compiler detection |
| 148 // | 152 // |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 // Annotate a function indicating the caller must examine the return value. | 432 // Annotate a function indicating the caller must examine the return value. |
| 429 // Use like: | 433 // Use like: |
| 430 // int foo() WARN_UNUSED_RESULT; | 434 // int foo() WARN_UNUSED_RESULT; |
| 431 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 435 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
| 432 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 436 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
| 433 #else | 437 #else |
| 434 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 438 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
| 435 #endif | 439 #endif |
| 436 | 440 |
| 437 #endif // V8CONFIG_H_ | 441 #endif // V8CONFIG_H_ |
| OLD | NEW |