diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2011-08-09 22:05:53 +0930 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2011-08-21 23:17:12 +0200 |
commit | 2667d2a5b34e1bbf322aea42876e7e81aa06dc29 (patch) | |
tree | 3387c57abe50d8a311a9e48fd56b6ddaba5ddaf4 /goo/gtypes.h | |
parent | c043f298e68bdfffcb7505ec354ec7487b5bd7b2 (diff) |
Use stdint.h instead of assuming the size of types
Diffstat (limited to 'goo/gtypes.h')
-rw-r--r-- | goo/gtypes.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/goo/gtypes.h b/goo/gtypes.h index b7a2dd2d..cb1cb89d 100644 --- a/goo/gtypes.h +++ b/goo/gtypes.h @@ -24,6 +24,8 @@ #ifndef GTYPES_H #define GTYPES_H +#include "config.h" + /* * These have stupid names to avoid conflicts with some (but not all) * C++ compilers which define them. @@ -45,4 +47,20 @@ typedef unsigned short Gushort; typedef unsigned int Guint; typedef unsigned long Gulong; +/* + * Define precise integer types. + */ +#if HAVE_STDINT_H +#include <stdint.h> +#elif _MSC_VER +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#endif + #endif |