| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium 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 BASE_BASICTYPES_H_ | 5 #ifndef BASE_BASICTYPES_H_ |
| 6 #define BASE_BASICTYPES_H_ | 6 #define BASE_BASICTYPES_H_ |
| 7 | 7 |
| 8 #include <limits.h> // So we can set the bounds of our types. | 8 #include <limits.h> // So we can set the bounds of our types. |
| 9 #include <stddef.h> // For size_t. | 9 #include <stddef.h> // For size_t. |
| 10 #include <stdint.h> // For intptr_t. | 10 #include <stdint.h> // For intptr_t. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // On Mac OS X, |long long| is used for 64-bit types for compatibility with | 36 // On Mac OS X, |long long| is used for 64-bit types for compatibility with |
| 37 // <inttypes.h> format macros even in the LP64 model. | 37 // <inttypes.h> format macros even in the LP64 model. |
| 38 #if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) | 38 #if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) |
| 39 typedef long int64; | 39 typedef long int64; |
| 40 typedef unsigned long uint64; | 40 typedef unsigned long uint64; |
| 41 #else | 41 #else |
| 42 typedef long long int64; | 42 typedef long long int64; |
| 43 typedef unsigned long long uint64; | 43 typedef unsigned long long uint64; |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 // A type to represent a Unicode code-point value. As of Unicode 4.0, | |
| 47 // such values require up to 21 bits. | |
| 48 // (For type-checking on pointers, make this explicitly signed, | |
| 49 // and it should always be the signed version of whatever int32 is.) | |
| 50 // TODO(vtl): This is almost completely unused in Chromium. Delete it? | |
| 51 typedef signed int char32; | |
| 52 | |
| 53 const uint8 kuint8max = (( uint8) 0xFF); | 46 const uint8 kuint8max = (( uint8) 0xFF); |
| 54 const uint16 kuint16max = ((uint16) 0xFFFF); | 47 const uint16 kuint16max = ((uint16) 0xFFFF); |
| 55 const uint32 kuint32max = ((uint32) 0xFFFFFFFF); | 48 const uint32 kuint32max = ((uint32) 0xFFFFFFFF); |
| 56 const uint64 kuint64max = ((uint64) GG_LONGLONG(0xFFFFFFFFFFFFFFFF)); | 49 const uint64 kuint64max = ((uint64) GG_LONGLONG(0xFFFFFFFFFFFFFFFF)); |
| 57 const int8 kint8min = (( int8) 0x80); | 50 const int8 kint8min = (( int8) 0x80); |
| 58 const int8 kint8max = (( int8) 0x7F); | 51 const int8 kint8max = (( int8) 0x7F); |
| 59 const int16 kint16min = (( int16) 0x8000); | 52 const int16 kint16min = (( int16) 0x8000); |
| 60 const int16 kint16max = (( int16) 0x7FFF); | 53 const int16 kint16max = (( int16) 0x7FFF); |
| 61 const int32 kint32min = (( int32) 0x80000000); | 54 const int32 kint32min = (( int32) 0x80000000); |
| 62 const int32 kint32max = (( int32) 0x7FFFFFFF); | 55 const int32 kint32max = (( int32) 0x7FFFFFFF); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 345 |
| 353 // Use these to declare and define a static local variable (static T;) so that | 346 // Use these to declare and define a static local variable (static T;) so that |
| 354 // it is leaked so that its destructors are not called at exit. If you need | 347 // it is leaked so that its destructors are not called at exit. If you need |
| 355 // thread-safe initialization, use base/lazy_instance.h instead. | 348 // thread-safe initialization, use base/lazy_instance.h instead. |
| 356 #define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \ | 349 #define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \ |
| 357 static type& name = *new type arguments | 350 static type& name = *new type arguments |
| 358 | 351 |
| 359 } // base | 352 } // base |
| 360 | 353 |
| 361 #endif // BASE_BASICTYPES_H_ | 354 #endif // BASE_BASICTYPES_H_ |
| OLD | NEW |