From ae274af4a69b92c4b5aa4b823a52d4e44392dd56 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 9 Oct 2010 09:58:00 +0000 Subject: [PATCH] Minor tuning to caca_types.h. --- caca/caca_types.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/caca/caca_types.h b/caca/caca_types.h index 7abcc17..d20dc5a 100644 --- a/caca/caca_types.h +++ b/caca/caca_types.h @@ -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__ #define __CACA_TYPES_H__ #if !defined _MSC_VER - /* FIXME: we should detect platforms with and no */ + /* FIXME: detect platforms with and no */ # include # include + +#elif defined _MSC_STDINT_H_ /* msinttypes */ \ + || defined NM_DEFINED_FIXED_WIDTH_TYPEDEFS /* Morpheme */ + /* Someone already defined things for us: do nothing */ + #else # if _MSC_VER >= 1600 /* Visual Studio 2010 and later */ # include # else -# include +# include # if _MSC_VER >= 1300 typedef signed __int8 int8_t; typedef signed __int16 int16_t; @@ -47,7 +52,7 @@ typedef unsigned long long int uint64_t; # endif # 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; # else /* Win32, only (u)intptr_t is present */ @@ -57,10 +62,10 @@ # endif #endif +#if 0 /* fallback: nothing is known, we assume the platform is 32-bit and * sizeof(long) == sizeof(void *). We don't typedef directly because we * have no idea what other typedefs have already been made. */ -#if 0 typedef signed char _caca_int8_t; typedef signed short _caca_int16_t; typedef signed long int _caca_int32_t;