Browse Source

Apparently some compilers hate macros being redefined..

Bart van Strien 13 years ago
parent
commit
cd330783f0
2 changed files with 10 additions and 10 deletions
  1. 8 8
      src/common/int.h
  2. 2 2
      src/modules/filesystem/physfs/File.cpp

+ 8 - 8
src/common/int.h

@@ -27,14 +27,14 @@
 #include <stdint.h>
 #endif
 
-#define INT8_MAX   0x7F
-#define UINT8_MAX  0xFF
-#define INT16_MAX  0x7FFF
-#define UINT16_MAX 0xFFFF
-#define INT32_MAX  0x7FFFFFFF
-#define UINT32_MAX 0xFFFFFFFF
-#define INT64_MAX  0x7FFFFFFFFFFFFFFF
-#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
+#define LOVE_INT8_MAX   0x7F
+#define LOVE_UINT8_MAX  0xFF
+#define LOVE_INT16_MAX  0x7FFF
+#define LOVE_UINT16_MAX 0xFFFF
+#define LOVE_INT32_MAX  0x7FFFFFFF
+#define LOVE_UINT32_MAX 0xFFFFFFFF
+#define LOVE_INT64_MAX  0x7FFFFFFFFFFFFFFF
+#define LOVE_UINT64_MAX 0xFFFFFFFFFFFFFFFF
 
 namespace love
 {

+ 2 - 2
src/modules/filesystem/physfs/File.cpp

@@ -140,7 +140,7 @@ namespace physfs
 		size = (size == ALL) ? max : size;
 		size = (size > max) ? max : size;
 		// Sadly, we'll have to clamp to 32 bits here
-		size = (size > UINT32_MAX) ? UINT32_MAX : size;
+		size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
 
 		int64 read = (int64)PHYSFS_read(file, dst, 1, size);
 
@@ -156,7 +156,7 @@ namespace physfs
 			throw love::Exception("Could not write to file. File not open.");
 
 		// Another clamp, for the time being.
-		size = (size > UINT32_MAX) ? UINT32_MAX : size;
+		size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
 
 		// Try to write.
 		int64 written = static_cast<int64>(PHYSFS_write(file, data, 1, size));