misc/libphysfs/physfs_internal.h
changeset 9125 c542f6e3a133
parent 9110 3883b5dc600c
child 9126 63bf1f4f40f8
--- a/misc/libphysfs/physfs_internal.h	Tue Jun 04 23:58:42 2013 +0400
+++ b/misc/libphysfs/physfs_internal.h	Tue Jun 04 22:08:17 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