[vlc-devel] [vlc-commits] contrib: use 32-bits LUAC file format on all platforms
Rémi Denis-Courmont
remi at remlab.net
Thu Dec 15 07:44:34 CET 2011
On Wed, 14 Dec 2011 23:20:31 +0100 (CET), git at videolan.org (Rémi
Denis-Courmont) wrote:
> vlc/vlc-1.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> |
Wed
> Dec 14 20:00:47 2011 +0200| [560ac72cec0dca2fe8c37ffe56141122c3a56739] |
> committer: Jean-Baptiste Kempf
>
> contrib: use 32-bits LUAC file format on all platforms
>
> In other words, 64-bits platform will support 32-bits LUAC files and
> reject 64-bits LUAC files when using contribs.
> This should ease cross-compilation and copying luac files manually.
> (cherry picked from commit 01ec2d6e8c9347a0c8fec3db0937ef786a97910e)
>
> Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
>
>>
http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=560ac72cec0dca2fe8c37ffe56141122c3a56739
> ---
>
> contrib/src/lua/luac-32bits.patch | 99
> +++++++++++++++++++++++++++++++++++++
> contrib/src/lua/rules.mak | 1 +
> 2 files changed, 100 insertions(+), 0 deletions(-)
>
> diff --git a/contrib/src/lua/luac-32bits.patch
> b/contrib/src/lua/luac-32bits.patch
> new file mode 100644
> index 0000000..9f34518
> --- /dev/null
> +++ b/contrib/src/lua/luac-32bits.patch
> @@ -0,0 +1,99 @@
> +diff -ru lua.orig/src/ldump.c lua/src/ldump.c
> +--- lua.orig/src/ldump.c 2011-12-14 19:26:18.000000000 +0200
> ++++ lua/src/ldump.c 2011-12-14 19:49:20.000000000 +0200
> +@@ -44,7 +44,8 @@
> +
> + static void DumpInt(int x, DumpState* D)
> + {
> +- DumpVar(x,D);
> ++ int32_t i = x;
> ++ DumpVar(i,D);
> + }
> +
> + static void DumpNumber(lua_Number x, DumpState* D)
> +@@ -62,12 +63,12 @@
> + {
> + if (s==NULL || getstr(s)==NULL)
> + {
> +- size_t size=0;
> ++ uint32_t size=0;
> + DumpVar(size,D);
> + }
> + else
> + {
> +- size_t size=s->tsv.len+1; /* include trailing '\0' */
> ++ uint32_t size=s->tsv.len+1; /* include trailing '\0' */
> + DumpVar(size,D);
> + DumpBlock(getstr(s),size,D);
> + }
> +diff -ru lua.orig/src/luaconf.h lua/src/luaconf.h
> +--- lua.orig/src/luaconf.h 2011-12-14 19:26:18.000000000 +0200
> ++++ lua/src/luaconf.h 2011-12-14 19:54:25.000000000 +0200
> +@@ -10,6 +10,8 @@
> +
> + #include <limits.h>
> + #include <stddef.h>
> ++#include <stdint.h>
> ++#include <sys/types.h>
> +
> +
> + /*
> +@@ -409,20 +411,12 @@
> + ** part always works, but may waste space on machines with 64-bit
> + ** longs.) Probably you do not need to change this.
> + */
> +-#if LUAI_BITSINT >= 32
> +-#define LUAI_UINT32 unsigned int
> +-#define LUAI_INT32 int
> +-#define LUAI_MAXINT32 INT_MAX
> ++
> ++#define LUAI_UINT32 uint32_t
> ++#define LUAI_INT32 int32_t
> ++#define LUAI_MAXINT32 0x7ffffff
I made a typo here actually :(
> + #define LUAI_UMEM size_t
> +-#define LUAI_MEM ptrdiff_t
> +-#else
> +-/* 16-bit ints */
> +-#define LUAI_UINT32 unsigned long
> +-#define LUAI_INT32 long
> +-#define LUAI_MAXINT32 LONG_MAX
> +-#define LUAI_UMEM unsigned long
> +-#define LUAI_MEM long
> +-#endif
> ++#define LUAI_MEM ssize_t
> +
> +
> + /*
> +Seulement dans lua/src: lua.o
And I missed this one for removal.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list