-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasictypes.h
31 lines (26 loc) · 1.39 KB
/
basictypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2016 Maodou.tech, Inc. All Rights Reserved
// Author: Zhang Shilong ([email protected])
// This file contains definitions of our old basic integral types
// ((u)int{8,16,32,64}) and further includes. I recommend that you use the C99
// standard types instead, and include <stdint.h>/<stddef.h>/etc. as needed.
// Note that the macros and macro-like constructs that were formerly defined in
// this file are now available separately in base/macros.h.
#ifndef BASE_COMMON_BASICTYPES_H_
#define BASE_COMMON_BASICTYPES_H_
#include <limits.h> // So we can set the bounds of our types.
#include <stddef.h> // For size_t.
#include <stdint.h> // For intptr_t.
// DEPRECATED: Please use std::numeric_limits (from <limits>) instead.
const uint8_t kuint8max = (( uint8_t) 0xFF);
const uint16_t kuint16max = ((uint16_t) 0xFFFF);
const uint32_t kuint32max = ((uint32_t) 0xFFFFFFFF);
const uint64_t kuint64max = ((uint64_t) 0xFFFFFFFFFFFFFFFFULL);
const int8_t kint8min = (( int8_t) 0x80);
const int8_t kint8max = (( int8_t) 0x7F);
const int16_t kint16min = (( int16_t) 0x8000);
const int16_t kint16max = (( int16_t) 0x7FFF);
const int32_t kint32min = (( int32_t) 0x80000000);
const int32_t kint32max = (( int32_t) 0x7FFFFFFF);
const int64_t kint64min = (( int64_t) 0x8000000000000000LL);
const int64_t kint64max = (( int64_t) 0x7FFFFFFFFFFFFFFFLL);
#endif // BASE_COMMON_BASICTYPES_H_