svn commit: r280676 - projects/lua-bootloader/sys/boot/liblua
Rui Paulo
rpaulo at FreeBSD.org
Thu Mar 26 07:27:40 UTC 2015
Author: rpaulo
Date: Thu Mar 26 07:27:38 2015
New Revision: 280676
URL: https://svnweb.freebsd.org/changeset/base/280676
Log:
Add more compatibility functions for lua 5.3.0.
Modified:
projects/lua-bootloader/sys/boot/liblua/Makefile
projects/lua-bootloader/sys/boot/liblua/lstd.c
projects/lua-bootloader/sys/boot/liblua/lstd.h
Modified: projects/lua-bootloader/sys/boot/liblua/Makefile
==============================================================================
--- projects/lua-bootloader/sys/boot/liblua/Makefile Thu Mar 26 07:26:28 2015 (r280675)
+++ projects/lua-bootloader/sys/boot/liblua/Makefile Thu Mar 26 07:27:38 2015 (r280676)
@@ -10,6 +10,8 @@ INTERNALLIB=
SRCS= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \
lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c \
ltm.c lundump.c lvm.c lzio.c
+SRCS+= lauxlib.c lbaselib.c lbitlib.c ldblib.c lstrlib.c ltablib.c loadlib.c \
+ linit.c
# Our utilities.
SRCS+= lstd.c lutils.c
@@ -17,7 +19,7 @@ SRCS+= lstd.c lutils.c
WARNS= 3
CFLAGS+= -DBOOT_LUA -ffreestanding -nostdlib
-CFLAGS+= -fno-stack-protector
+CFLAGS+= -fno-stack-protector -D__BSD_VISIBLE
CFLAGS+= -I${.CURDIR}/../liblua -I${LUA_PATH} -I${.CURDIR}/../common
.if ${MACHINE_CPUARCH} == "i386" || \
Modified: projects/lua-bootloader/sys/boot/liblua/lstd.c
==============================================================================
--- projects/lua-bootloader/sys/boot/liblua/lstd.c Thu Mar 26 07:26:28 2015 (r280675)
+++ projects/lua-bootloader/sys/boot/liblua/lstd.c Thu Mar 26 07:27:38 2015 (r280676)
@@ -462,4 +462,12 @@ memchr(const void *s, int c, size_t n)
return (NULL);
}
+void
+abort(void)
+{
+ printf("abort called!\n");
+ for (;;)
+ ;
+}
+
#endif /* BOOT_LUA */
Modified: projects/lua-bootloader/sys/boot/liblua/lstd.h
==============================================================================
--- projects/lua-bootloader/sys/boot/liblua/lstd.h Thu Mar 26 07:26:28 2015 (r280675)
+++ projects/lua-bootloader/sys/boot/liblua/lstd.h Thu Mar 26 07:27:38 2015 (r280676)
@@ -38,6 +38,7 @@
#include <string.h>
#include <machine/stdarg.h>
+
typedef struct FILE
{
int fd;
@@ -97,5 +98,43 @@ int ispunct(int c);
void * memchr(const void *ptr, int value, size_t num);
+void abort(void) __dead2;
+
+static inline char
+_l_getlocaledecpoint(void)
+{
+ return ('.');
+}
+
+#ifndef l_getlocaledecpoint
+#define l_getlocaledecpoint _l_getlocaledecpoint
+#endif
+
+#ifndef lua_writestringerror
+#define lua_writestringerror(s,p) \
+ (printf((s), (p)))
+#endif
+
+#ifndef lua_writestring
+#define lua_writestring(s,l) \
+ (write(1, __DECONST(void *, (s)), (l)))
+#endif
+
+#define stdout 1
+#define fflush /* */
+#define fgets(b,l,s) fgetstr((b), (l), 0)
+
+static inline double
+frexp(double value, int *exp)
+{
+ return 0; /* XXX */
+}
+
+static inline double
+fmod(double x, double y)
+{
+ return 0; /* XXX */
+}
+
#endif
#endif //LSTD_H
More information about the svn-src-projects
mailing list