summaryrefslogtreecommitdiff
blob: 911edcc79d3405e3640a181e020769f358c87875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
diff -r d6d89bbc08e5 -r 692b7872324b include/squirrel.h
--- a/include/squirrel.h	Thu Feb 11 15:08:35 2010 -0500
+++ b/include/squirrel.h	Sat Feb 13 01:04:21 2010 -0500
@@ -39,28 +39,22 @@
 #define SQUIRREL_API extern
 #endif
 
-#if (defined(_WIN64) || defined(_LP64))
-#define _SQ64
-#endif
+/* Get uintptr_t from a non standard or standard location */
+#ifdef _MSC_VER
+#include <stddef.h>
 
-#ifdef _SQ64
-#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
+typedef __int32 SQInt32;
+typedef __int64 SQInt64;
+#else /* _MSC_VER */
+#include <stdint.h>
 
+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 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 @@
 } /*extern "C"*/
 #endif
 
+/*
+  Define for code which depends on squirrel to
+  determine bitiness. IMO, this should be discouraged.
+  --ohnobinki
+*/
+#if (defined(_WIN64) || defined(_LP64))
+#define _SQ64
+#endif
+
 #endif /*_SQUIRREL_H_*/