Compare commits
3 Commits
bd9a3d3b99
...
cbd613e068
| Author | SHA1 | Date | |
|---|---|---|---|
| cbd613e068 | |||
| 0eaae16280 | |||
| 519de693ec |
58
int.h
58
int.h
@ -4,20 +4,54 @@
|
||||
#define __WORDSIZE 32
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long uint64_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
typedef char int8_t;
|
||||
typedef short int16_t;
|
||||
typedef int int32_t;
|
||||
typedef long int64_t;
|
||||
typedef char int8_t;
|
||||
typedef short int16_t;
|
||||
typedef int int32_t;
|
||||
typedef long long int64_t;
|
||||
|
||||
#if __WORDSIZE == 64
|
||||
typedef long intptr_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
typedef int64_t intptr_t;
|
||||
typedef uint64_t uintptr_t;
|
||||
#elif __WORDSIZE == 32
|
||||
typedef int intptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
typedef int32_t intptr_t;
|
||||
typedef uint32_t uintptr_t;
|
||||
#endif
|
||||
|
||||
// Compile time tests in supported compilers
|
||||
#ifdef __SIZEOF_CHAR__
|
||||
#if __SIZEOF_CHAR__ != 1
|
||||
#error __SIZEOF_CHAR__ is not 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __SIZEOF_SHORT__
|
||||
#if __SIZEOF_SHORT__ != 2
|
||||
#error __SIZEOF_SHORT__ is not 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __SIZEOF_INT__
|
||||
#if __SIZEOF_INT__ != 4
|
||||
#error __SIZEOF_INT__ is not 4
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __SIZEOF_LONG_LONG__
|
||||
#if __SIZEOF_LONG_LONG__ != 8
|
||||
#error __SIZEOF_LONG_LONG__ is not 8
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __SIZEOF_POINTER__
|
||||
#if __SIZEOF_POINTER__ != (__WORDSIZE / 8)
|
||||
#error __SIZEOF_POINTER__ is not (__WORDSIZE / 8)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//TODO:
|
||||
//#ifdef __SIZEOF_SIZE_T__
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user