From: mathnerd314 Date: Sun, 21 Feb 2010 23:23:51 +0000 (+0000) Subject: Simplify include/squirrel.h (from ohnobinki; patch submitted upstream and untested... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8a48283d50b5746bd1fe4d36318dda78ef2b61db;p=supertux.git Simplify include/squirrel.h (from ohnobinki; patch submitted upstream and untested on MSVC) git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6384 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/external/squirrel/include/squirrel.h b/external/squirrel/include/squirrel.h index 141908dc7..d7334034c 100644 --- a/external/squirrel/include/squirrel.h +++ b/external/squirrel/include/squirrel.h @@ -39,28 +39,22 @@ extern "C" { #define SQUIRREL_API extern #endif -#if (defined(_WIN64) || defined(_LP64)) -#define _SQ64 -#endif - -#ifdef _SQ64 +/* Get uintptr_t from a non standard or standard location */ #ifdef _MSC_VER -typedef __int64 SQInteger; -typedef unsigned __int64 SQUnsignedInteger; -typedef unsigned __int64 SQHash; /*should be the same size of a pointer*/ -#else -typedef long SQInteger; -typedef unsigned long SQUnsignedInteger; -typedef unsigned long SQHash; /*should be the same size of a pointer*/ -#endif -typedef int SQInt32; -#else -typedef int SQInteger; -typedef int SQInt32; /*must be 32 bits(also on 64bits processors)*/ -typedef unsigned int SQUnsignedInteger; -typedef unsigned int SQHash; /*should be the same size of a pointer*/ -#endif +#include + +typedef __int32 SQInt32; +typedef __int64 SQInt64; +#else /* _MSC_VER */ +#include + +typedef int32_t SQInt32; +typedef int64_t SQInt64; +#endif /* _MSC_VER */ +typedef intptr_t SQInteger; +typedef uintptr_t SQUnsignedInteger; +typedef uintptr_t SQHash; #ifdef SQUSEDOUBLE typedef double SQFloat; @@ -68,12 +62,8 @@ typedef double SQFloat; typedef float SQFloat; #endif -#if defined(SQUSEDOUBLE) && !defined(_SQ64) -#ifdef _MSC_VER -typedef __int64 SQRawObjectVal; //must be 64bits -#else -typedef long SQRawObjectVal; //must be 64bits -#endif +#if defined(SQUSEDOUBLE) +typedef SQInt64 SQRawObjectVal; /* must be 64 bits */ #define SQ_OBJECT_RAWINIT() { _unVal.raw = 0; } #else typedef SQUnsignedInteger SQRawObjectVal; //is 32 bits on 32 bits builds and 64 bits otherwise @@ -453,4 +443,13 @@ SQUIRREL_API void sq_setdebughook(HSQUIRRELVM v); } /*extern "C"*/ #endif +/* + define for code which depend on squirrel to + determine bitiness. IMO, this should be discouraged. + --ohnobinki +*/ +#if (defined(_WIN64) || defined(_LP64)) +#define _SQ64 +#endif + #endif /*_SQUIRREL_H_*/