瀏覽代碼

* Temporary fix for bugreport:4961 (unintended conversion from signed to unsigned).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14896 54d463be-8e91-2dee-dedb-b68131a5f0ec
flaviojs 14 年之前
父節點
當前提交
2ca6ba676f
共有 2 個文件被更改,包括 12 次插入0 次删除
  1. 2 0
      Changelog-Trunk.txt
  2. 10 0
      src/common/cbasetypes.h

+ 2 - 0
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]

+ 10 - 0
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