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 |
3 | // found in the LICENSE file. |
4 | |
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 |
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 |
9 | // this file are now available separately in butil/macros.h. |
10 | |
11 | #ifndef BUTIL_BASICTYPES_H_ |
12 | #define BUTIL_BASICTYPES_H_ |
13 | |
14 | #include <limits.h> // So we can set the bounds of our types. |
15 | #include <stddef.h> // For size_t. |
16 | #include <stdint.h> // For intptr_t. |
17 | |
18 | #include "butil/macros.h" |
19 | #include "butil/port.h" // Types that only need exist on certain systems. |
20 | |
21 | // DEPRECATED: Please use std::numeric_limits (from <limits>) instead. |
22 | const uint8_t kuint8max = (( uint8_t) 0xFF); |
23 | const uint16_t kuint16max = ((uint16_t) 0xFFFF); |
24 | const uint32_t kuint32max = ((uint32_t) 0xFFFFFFFF); |
25 | const uint64_t kuint64max = ((uint64_t) 0xFFFFFFFFFFFFFFFFULL); |
26 | const int8_t kint8min = (( int8_t) 0x80); |
27 | const int8_t kint8max = (( int8_t) 0x7F); |
28 | const int16_t kint16min = (( int16_t) 0x8000); |
29 | const int16_t kint16max = (( int16_t) 0x7FFF); |
30 | const int32_t kint32min = (( int32_t) 0x80000000); |
31 | const int32_t kint32max = (( int32_t) 0x7FFFFFFF); |
32 | const int64_t kint64min = (( int64_t) 0x8000000000000000LL); |
33 | const int64_t kint64max = (( int64_t) 0x7FFFFFFFFFFFFFFFLL); |
34 | |
35 | #endif // BUTIL_BASICTYPES_H_ |
36 | |