summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-10 13:28:49 +0000
committerflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-10 13:28:49 +0000
commitee66778144c8a069a04d5f77ec73dcab973c61d0 (patch)
treeb6a85695656a1916a77e6a387b46920afc67fbc3
parent201d8bb6a488ad6ef7eed4c46ad14228d543b71d (diff)
downloadhercules-ee66778144c8a069a04d5f77ec73dcab973c61d0.tar.gz
hercules-ee66778144c8a069a04d5f77ec73dcab973c61d0.tar.bz2
hercules-ee66778144c8a069a04d5f77ec73dcab973c61d0.tar.xz
hercules-ee66778144c8a069a04d5f77ec73dcab973c61d0.zip
* Temporary fix for bugreport:4961 (unintended conversion from signed to unsigned).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14896 54d463be-8e91-2dee-dedb-b68131a5f0ec
-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