OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
| 28 #ifndef V8_GLOBALS_H_ |
| 29 #define V8_GLOBALS_H_ |
| 30 |
28 // ----------------------------------------------------------------------------- | 31 // ----------------------------------------------------------------------------- |
29 // Types | 32 // Types |
30 // Windows is missing the stdint.h header file. Instead we define standard | 33 // Windows is missing the stdint.h header file. Instead we define standard |
31 // integer types for Windows here. | 34 // integer types for Windows here. |
32 | 35 |
33 #ifdef WIN32 | 36 #ifdef WIN32 |
34 typedef signed char int8_t; | 37 typedef signed char int8_t; |
35 typedef unsigned char uint8_t; | 38 typedef unsigned char uint8_t; |
36 typedef short int16_t; // NOLINT | 39 typedef short int16_t; // NOLINT |
37 typedef unsigned short uint16_t; // NOLINT | 40 typedef unsigned short uint16_t; // NOLINT |
(...skipping 13 matching lines...) Expand all Loading... |
51 // For instance, 'bool b = "false";' results in b == true! This is a hidden | 54 // For instance, 'bool b = "false";' results in b == true! This is a hidden |
52 // source of bugs. | 55 // source of bugs. |
53 // However, redefining the bool type does have some negative impact on some | 56 // However, redefining the bool type does have some negative impact on some |
54 // platforms. It gives rise to compiler warnings (i.e. with | 57 // platforms. It gives rise to compiler warnings (i.e. with |
55 // MSVC) in the API header files when mixing code that uses the standard | 58 // MSVC) in the API header files when mixing code that uses the standard |
56 // bool with code that uses the redefined version. | 59 // bool with code that uses the redefined version. |
57 // This does not actually belong in the platform code, but needs to be | 60 // This does not actually belong in the platform code, but needs to be |
58 // defined here because the platform code uses bool, and platform.h is | 61 // defined here because the platform code uses bool, and platform.h is |
59 // include very early in the main include file. | 62 // include very early in the main include file. |
60 | 63 |
61 #ifndef V8_GLOBALS_H_ | |
62 #define V8_GLOBALS_H_ | |
63 | |
64 #ifdef USE_MYBOOL | 64 #ifdef USE_MYBOOL |
65 typedef unsigned int __my_bool__; | 65 typedef unsigned int __my_bool__; |
66 #define bool __my_bool__ // use 'indirection' to avoid name clashes | 66 #define bool __my_bool__ // use 'indirection' to avoid name clashes |
67 #endif | 67 #endif |
68 | 68 |
69 typedef uint8_t byte; | 69 typedef uint8_t byte; |
70 typedef byte* Address; | 70 typedef byte* Address; |
71 | 71 |
72 // Code-point values in Unicode 4.0 are 21 bits wide. | 72 // Code-point values in Unicode 4.0 are 21 bits wide. |
73 typedef uint16_t uc16; | 73 typedef uint16_t uc16; |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 497 |
498 Dest dest; | 498 Dest dest; |
499 memcpy(&dest, &source, sizeof(dest)); | 499 memcpy(&dest, &source, sizeof(dest)); |
500 return dest; | 500 return dest; |
501 } | 501 } |
502 | 502 |
503 | 503 |
504 } } // namespace v8::internal | 504 } } // namespace v8::internal |
505 | 505 |
506 #endif // V8_GLOBALS_H_ | 506 #endif // V8_GLOBALS_H_ |
OLD | NEW |