| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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_ | 28 #ifndef V8_GLOBALS_H_ |
| 29 #define V8_GLOBALS_H_ | 29 #define V8_GLOBALS_H_ |
| 30 | 30 |
| 31 // ----------------------------------------------------------------------------- | 31 // ----------------------------------------------------------------------------- |
| 32 // Types | 32 // Types |
| 33 // Windows is missing the stdint.h header file. Instead we define standard | 33 // Visual Studio C++ is missing the stdint.h header file. Instead we define |
| 34 // integer types for Windows here. | 34 // standard integer types for Windows here. |
| 35 | 35 |
| 36 #ifdef WIN32 | 36 #ifdef _MSC_VER |
| 37 typedef signed char int8_t; | 37 typedef signed char int8_t; |
| 38 typedef unsigned char uint8_t; | 38 typedef unsigned char uint8_t; |
| 39 typedef short int16_t; // NOLINT | 39 typedef short int16_t; // NOLINT |
| 40 typedef unsigned short uint16_t; // NOLINT | 40 typedef unsigned short uint16_t; // NOLINT |
| 41 typedef int int32_t; | 41 typedef int int32_t; |
| 42 typedef unsigned int uint32_t; | 42 typedef unsigned int uint32_t; |
| 43 typedef __int64 int64_t; | 43 typedef __int64 int64_t; |
| 44 typedef unsigned __int64 uint64_t; | 44 typedef unsigned __int64 uint64_t; |
| 45 #else | 45 #else // _MSC_VER |
| 46 #include <stdint.h> // for intptr_t | 46 #include <stdint.h> // for intptr_t |
| 47 #endif | 47 #endif // _MSC_VER |
| 48 | 48 |
| 49 | 49 |
| 50 namespace v8 { namespace internal { | 50 namespace v8 { namespace internal { |
| 51 | 51 |
| 52 // Support for alternative bool type. This is only enabled if the code is | 52 // Support for alternative bool type. This is only enabled if the code is |
| 53 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. | 53 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. |
| 54 // 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 |
| 55 // source of bugs. | 55 // source of bugs. |
| 56 // 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 |
| 57 // platforms. It gives rise to compiler warnings (i.e. with | 57 // platforms. It gives rise to compiler warnings (i.e. with |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 507 |
| 508 Dest dest; | 508 Dest dest; |
| 509 memcpy(&dest, &source, sizeof(dest)); | 509 memcpy(&dest, &source, sizeof(dest)); |
| 510 return dest; | 510 return dest; |
| 511 } | 511 } |
| 512 | 512 |
| 513 | 513 |
| 514 } } // namespace v8::internal | 514 } } // namespace v8::internal |
| 515 | 515 |
| 516 #endif // V8_GLOBALS_H_ | 516 #endif // V8_GLOBALS_H_ |
| OLD | NEW |