Chromium Code Reviews| 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 // This file contains definitions of our old basic integral types | 5 // This file contains definitions of our old basic integral types |
| 6 // ((u)int{8,16,32,64}) and further includes. I recommend that you use the C99 | 6 // ((u)int{8,16,32,64}) and further includes. I recommend that you use the C99 |
| 7 // standard types instead, and include <stdint.h>/<stddef.h>/etc. as needed. | 7 // standard types instead, and include <stdint.h>/<stddef.h>/etc. as needed. |
| 8 // Note that the macros and macro-like constructs that were formerly defined in | 8 // Note that the macros and macro-like constructs that were formerly defined in |
| 9 // this file are now available separately in base/macros.h. | 9 // this file are now available separately in base/macros.h. |
| 10 | 10 |
| 11 #ifndef BASE_BASICTYPES_H_ | 11 #ifndef BASE_BASICTYPES_H_ |
| 12 #define BASE_BASICTYPES_H_ | 12 #define BASE_BASICTYPES_H_ |
| 13 | 13 |
| 14 #include <limits.h> // So we can set the bounds of our types. | 14 #include <limits.h> // So we can set the bounds of our types. |
| 15 #include <stddef.h> // For size_t. | 15 #include <stddef.h> // For size_t. |
| 16 #include <stdint.h> // For intptr_t. | 16 #include <stdint.h> // For intptr_t. |
| 17 | 17 |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/port.h" // Types that only need exist on certain systems. | |
|
Lei Zhang
2015/06/11 19:32:35
I think this pulled in build/build_config.h, which
tfarina
2015/06/11 20:30:06
Done.
| |
| 20 | 19 |
| 21 // DEPRECATED: Please use (u)int{8,16,32,64}_t instead (and include <stdint.h>). | 20 // DEPRECATED: Please use (u)int{8,16,32,64}_t instead (and include <stdint.h>). |
| 22 typedef int8_t int8; | 21 typedef int8_t int8; |
| 23 typedef uint8_t uint8; | 22 typedef uint8_t uint8; |
| 24 typedef int16_t int16; | 23 typedef int16_t int16; |
| 25 typedef uint16_t uint16; | 24 typedef uint16_t uint16; |
| 26 typedef int32_t int32; | 25 typedef int32_t int32; |
| 27 typedef uint32_t uint32; | 26 typedef uint32_t uint32; |
| 28 typedef int64_t int64; | 27 typedef int64_t int64; |
| 29 typedef uint64_t uint64; | 28 typedef uint64_t uint64; |
| 30 | 29 |
| 31 // DEPRECATED: Please use std::numeric_limits (from <limits>) instead. | 30 // DEPRECATED: Please use std::numeric_limits (from <limits>) instead. |
| 32 const uint8 kuint8max = 0xFF; | 31 const uint8 kuint8max = 0xFF; |
| 33 const uint16 kuint16max = 0xFFFF; | 32 const uint16 kuint16max = 0xFFFF; |
| 34 const uint32 kuint32max = 0xFFFFFFFF; | 33 const uint32 kuint32max = 0xFFFFFFFF; |
| 35 const uint64 kuint64max = 0xFFFFFFFFFFFFFFFFULL; | 34 const uint64 kuint64max = 0xFFFFFFFFFFFFFFFFULL; |
| 36 const int8 kint8min = -0x7F - 1; | 35 const int8 kint8min = -0x7F - 1; |
| 37 const int8 kint8max = 0x7F; | 36 const int8 kint8max = 0x7F; |
| 38 const int16 kint16min = -0x7FFF - 1; | 37 const int16 kint16min = -0x7FFF - 1; |
| 39 const int16 kint16max = 0x7FFF; | 38 const int16 kint16max = 0x7FFF; |
| 40 const int32 kint32min = -0x7FFFFFFF - 1; | 39 const int32 kint32min = -0x7FFFFFFF - 1; |
| 41 const int32 kint32max = 0x7FFFFFFF; | 40 const int32 kint32max = 0x7FFFFFFF; |
| 42 const int64 kint64min = -0x7FFFFFFFFFFFFFFFLL - 1; | 41 const int64 kint64min = -0x7FFFFFFFFFFFFFFFLL - 1; |
| 43 const int64 kint64max = 0x7FFFFFFFFFFFFFFFLL; | 42 const int64 kint64max = 0x7FFFFFFFFFFFFFFFLL; |
| 44 | 43 |
| 45 #endif // BASE_BASICTYPES_H_ | 44 #endif // BASE_BASICTYPES_H_ |
| OLD | NEW |