diff options
Diffstat (limited to 'debian/patches/0002-Fix-code-which-needed-a-32-bit-int-to-not-use-int-lo.patch')
-rw-r--r-- | debian/patches/0002-Fix-code-which-needed-a-32-bit-int-to-not-use-int-lo.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/debian/patches/0002-Fix-code-which-needed-a-32-bit-int-to-not-use-int-lo.patch b/debian/patches/0002-Fix-code-which-needed-a-32-bit-int-to-not-use-int-lo.patch new file mode 100644 index 00000000..3cc54503 --- /dev/null +++ b/debian/patches/0002-Fix-code-which-needed-a-32-bit-int-to-not-use-int-lo.patch @@ -0,0 +1,58 @@ +From 448e655d55608b18ed6e8e387d5f9c86356900c8 Mon Sep 17 00:00:00 2001 +From: Manoj Srivastava <srivasta@debian.org> +Date: Tue, 21 Oct 2008 08:25:47 -0500 +Subject: [PATCH 2/3] Fix code which needed a 32 bit int to not use int/long + +On amd64, but not on i386, tome produces LUA errors at various +times. The errors occur at savefile load, when wileding a weapon, +unweilding a weapon, and for other events. The same homedir, same +savefiles, same config, same etc., does not produce errors in the +32bit build of the package. + +The error seems to be that the type Number needs to be a 32bit wide +integer; and seems to be defined by default as an long, with an option +to define it as an int for amd64. However, for the 11 arches Debian +supports, this would lead to a morass of selecting architectures in +the makefile to override the type; a better solution is to use +stdint.h and use a type which is 32 bits wide by design: int32_t. + +This fixes the LUA errors, and Closes: Bug#419825 + +Signed-off-by: Manoj Srivastava <srivasta@debian.org> +--- + src/lua/llimits.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/lua/llimits.h b/src/lua/llimits.h +index 4b12450..39a1e0d 100644 +--- a/src/lua/llimits.h ++++ b/src/lua/llimits.h +@@ -10,6 +10,7 @@ + + #include <limits.h> + #include <stddef.h> ++#include <stdint.h> + + + +@@ -36,7 +37,7 @@ + ** GREP LUA_NUMBER to change that + */ + #ifndef LUA_NUM_TYPE +-#define LUA_NUM_TYPE long ++#define LUA_NUM_TYPE int32_t + #endif + + typedef LUA_NUM_TYPE Number; +@@ -50,7 +51,7 @@ typedef LUA_NUM_TYPE Number; + + + +-typedef unsigned long lint32; /* unsigned int with at least 32 bits */ ++typedef int_least32_t lint32; /* unsigned int with at least 32 bits */ + + + #define MAX_SIZET ((size_t)(~(size_t)0)-2) +-- +2.0.0.rc2 + |