1 #ifndef C_TYPE_H 2 #define C_TYPE_H 3 #include <stdint.h> 4 5 6 7 8 typedef signed char int8_t; 9 typedef short int int16_t; 10 typedef int int32_t; 11 12 #define INT8_T int8_t 13 #define INT16_T int16_t 14 #define INT16 int16_t 15 #define INT32_T int32_t 16 17 18 19 20 # if __WORDSIZE == 64 21 typedef long int int64_t; 22 #define INT64_T int64_t 23 # else 24 __extension__ 25 typedef long long int int64_t; 26 #define INT64_T int64_t 27 # endif 28 #endif 29 30 /* Unsigned. */ 31 typedef unsigned char uint8_t; 32 typedef unsigned short int uint16_t; 33 34 #define UINT8_T uint8_t 35 #define UINT16_T uint16_t 36 #define UINT16 uint16_t 37 38 #ifndef __uint32_t_defined 39 typedef unsigned int uint32_t; 40 #define UINT32_T uint32_t 41 # define __uint32_t_defined 42 #endif 43 #if __WORDSIZE == 64 44 typedef unsigned long int uint64_t; 45 #define UINT64_T uint64_t 46 47 typedef unsigned char BYTE; 48 typedef unsigned short WORD; 49 typedef unsigned long DWORD; 50 #else 51 __extension__ 52 typedef unsigned long long int uint64_t; 53 54 typedef unsigned char BYTE; 55 typedef unsigned short WORD; 56 typedef unsigned long DWORD; 57 58 59 #endif // C_TYPE_H
时间: 2024-10-22 05:34:25