summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/common/cbasetypes.h10
2 files changed, 12 insertions, 0 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 571fbdd0a..4d512c8da 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,5 +1,7 @@
Date Added
+2011/07/10
+ * Temporary fix for bugreport:4961 (unintended conversion from signed to unsigned). [FlavioJS]
2011/07/09
* Added script command 'getmercinfo' for retrieving information about a mercenary of an online character. [Ai4rei]
* CMake: added search for math library, made CPack existence optional, updated the search for mysqlclient and corrected misspelled variables (tested with FreeBSD-8.2-i386) [FlavioJS]
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index e2fe17555..27420edbf 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -81,6 +81,16 @@
#include <stdint.h>
#include <limits.h>
+// temporary fix for bugreport:4961 (unintended conversion from signed to unsigned)
+// (-20 >= UCHAR_MAX) returns true
+// (-20 >= USHRT_MAX) returns true
+#if defined(__FreeBSD__) && defined(__x86_64)
+#undef UCHAR_MAX
+#define UCHAR_MAX (unsigned char)0xff
+#undef USHRT_MAX
+#define USHRT_MAX (unsigned short)0xffff
+#endif
+
// ILP64 isn't supported, so always 32 bits?
#ifndef UINT_MAX
#define UINT_MAX 0xffffffff