misc/libphysfs/physfs_internal.h
branch0.9.19
changeset 9110 3883b5dc600c
parent 8524 a65e9bcf0a03
child 9126 63bf1f4f40f8
--- a/misc/libphysfs/physfs_internal.h	Mon Jun 03 23:09:06 2013 +0200
+++ b/misc/libphysfs/physfs_internal.h	Mon Jun 03 23:21:29 2013 +0200
@@ -322,8 +322,13 @@
 #define __PHYSFS_ARRAYLEN(x) ( (sizeof (x)) / (sizeof (x[0])) )
 
 #ifdef PHYSFS_NO_64BIT_SUPPORT
-#define __PHYSFS_SI64(x) ((PHYSFS_sint64) (x))
-#define __PHYSFS_UI64(x) ((PHYSFS_uint64) (x))
+/* if a 32bit compiler sees something with this many bits: 0xFFFFFFFFFFFFFFFF
+ *  it doesn't know if it really means 64bit or if it's supposed to squeeze
+ *  it into 32 bit, so without the ULL it squeezes the number to 32 bit,
+ *  with it it forces it to be 64bits
+ */
+#define __PHYSFS_SI64(x) ((PHYSFS_sint64) (x##LL))
+#define __PHYSFS_UI64(x) ((PHYSFS_uint64) (x##ULL))
 #elif (defined __GNUC__)
 #define __PHYSFS_SI64(x) x##LL
 #define __PHYSFS_UI64(x) x##ULL