| @@ -11,22 +11,27 @@ | |||||
| */ | */ | ||||
| /* | /* | ||||
| * This file contains definitions for the C99 integer types. | |||||
| * This file contains definitions for required C99 integer types. | |||||
| */ | */ | ||||
| #ifndef __CACA_TYPES_H__ | #ifndef __CACA_TYPES_H__ | ||||
| #define __CACA_TYPES_H__ | #define __CACA_TYPES_H__ | ||||
| #if !defined _MSC_VER | #if !defined _MSC_VER | ||||
| /* FIXME: we should detect platforms with <inttypes.h> and no <stdint.h> */ | |||||
| /* FIXME: detect platforms with <inttypes.h> and no <stdint.h> */ | |||||
| # include <stdint.h> | # include <stdint.h> | ||||
| # include <unistd.h> | # include <unistd.h> | ||||
| #elif defined _MSC_STDINT_H_ /* msinttypes */ \ | |||||
| || defined NM_DEFINED_FIXED_WIDTH_TYPEDEFS /* Morpheme */ | |||||
| /* Someone already defined things for us: do nothing */ | |||||
| #else | #else | ||||
| # if _MSC_VER >= 1600 | # if _MSC_VER >= 1600 | ||||
| /* Visual Studio 2010 and later */ | /* Visual Studio 2010 and later */ | ||||
| # include <stdint.h> | # include <stdint.h> | ||||
| # else | # else | ||||
| # include <windows.h> | |||||
| # include <intsafe.h> | |||||
| # if _MSC_VER >= 1300 | # if _MSC_VER >= 1300 | ||||
| typedef signed __int8 int8_t; | typedef signed __int8 int8_t; | ||||
| typedef signed __int16 int16_t; | typedef signed __int16 int16_t; | ||||
| @@ -47,7 +52,7 @@ | |||||
| typedef unsigned long long int uint64_t; | typedef unsigned long long int uint64_t; | ||||
| # endif | # endif | ||||
| # if defined _WIN64 | # if defined _WIN64 | ||||
| /* Win64, only (u)intptr_t and size_t are present */ | |||||
| /* Win64, (u)intptr_t and size_t are present */ | |||||
| typedef int ssize_t; | typedef int ssize_t; | ||||
| # else | # else | ||||
| /* Win32, only (u)intptr_t is present */ | /* Win32, only (u)intptr_t is present */ | ||||
| @@ -57,10 +62,10 @@ | |||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| #if 0 | |||||
| /* fallback: nothing is known, we assume the platform is 32-bit and | /* fallback: nothing is known, we assume the platform is 32-bit and | ||||
| * sizeof(long) == sizeof(void *). We don't typedef directly because we | * sizeof(long) == sizeof(void *). We don't typedef directly because we | ||||
| * have no idea what other typedefs have already been made. */ | * have no idea what other typedefs have already been made. */ | ||||
| #if 0 | |||||
| typedef signed char _caca_int8_t; | typedef signed char _caca_int8_t; | ||||
| typedef signed short _caca_int16_t; | typedef signed short _caca_int16_t; | ||||
| typedef signed long int _caca_int32_t; | typedef signed long int _caca_int32_t; | ||||