You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
2.8 KiB
C++
132 lines
2.8 KiB
C++
/*
|
|
* one.c -- Lua core, libraries, and interpreter in a single file (Lua 5.3)
|
|
* modified from one.tar.gz avaialble here: https://www.lua.org/extras/5.3/
|
|
* These files are distributed under the Lua license:
|
|
* http://www.lua.org/license.html
|
|
*/
|
|
|
|
/* default is to build only the lib */
|
|
#ifndef MAKE_LIB
|
|
#ifndef MAKE_LUAC
|
|
#ifndef MAKE_LUA
|
|
#define MAKE_LIB
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
/* choose suitable platform-specific features */
|
|
/* some of these may need extra libraries such as -ldl -lreadline -lncurses */
|
|
/*
|
|
#define LUA_USE_LINUX
|
|
#define LUA_USE_MACOSX
|
|
#define LUA_USE_POSIX
|
|
#define LUA_USE_DLOPEN
|
|
#define LUA_USE_READLINE
|
|
*/
|
|
|
|
/* other specific features */
|
|
/*
|
|
#define LUA_32BITS
|
|
#define LUA_USE_C89
|
|
#define LUA_C89_NUMBERS
|
|
*/
|
|
|
|
/* no need to change anything below this line ----------------------------- */
|
|
|
|
/* activate system definitions in lprefix.h */
|
|
#include "lprefix.h"
|
|
#include <assert.h>
|
|
#include <ctype.h>
|
|
#include <errno.h>
|
|
#include <float.h>
|
|
#include <limits.h>
|
|
#include <locale.h>
|
|
#include <math.h>
|
|
#include <setjmp.h>
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <time.h>
|
|
|
|
/* setup for luaconf.h */
|
|
#define LUA_CORE
|
|
#define LUA_LIB
|
|
#define lvm_c
|
|
#include "luaconf.h"
|
|
|
|
/* do not export internal symbols */
|
|
// this dicklicker piece of shit called C++ doesn't allow forward declarations
|
|
// of static variables, you'd have to use an anonymous namespace, but after
|
|
// namespace you need a limpdick curly bracket, so I can't put it into the macro
|
|
// here, so just export those faggot variables
|
|
#undef LUAI_FUNC
|
|
#undef LUAI_DDEC
|
|
#undef LUAI_DDEF
|
|
#define LUAI_FUNC static
|
|
#define LUAI_DDEC extern
|
|
#define LUAI_DDEF
|
|
|
|
// build as extern "C"
|
|
#undef LUA_API
|
|
#ifdef LUA_BUILD_AS_DLL
|
|
#define LUA_API extern "C" __declspec(dllexport)
|
|
#else
|
|
#define LUA_API extern "C" __attribute((visibility("default")))
|
|
#endif
|
|
|
|
/* core -- used by all */
|
|
#include "lapi.c"
|
|
#include "lcode.c"
|
|
#include "lctype.c"
|
|
#include "ldebug.c"
|
|
#include "ldo.c"
|
|
#include "ldump.c"
|
|
#include "lfunc.c"
|
|
#include "lgc.c"
|
|
#include "llex.c"
|
|
#include "lmem.c"
|
|
#include "lobject.c"
|
|
#include "lopcodes.c"
|
|
#include "lparser.c"
|
|
#include "lstate.c"
|
|
#include "lstring.c"
|
|
#include "ltable.c"
|
|
#include "ltm.c"
|
|
#include "lundump.c"
|
|
#include "lvm.c"
|
|
#include "lzio.c"
|
|
|
|
/* auxiliary library -- used by all */
|
|
#include "lauxlib.c"
|
|
|
|
/* standard library -- not used by luac */
|
|
#ifndef MAKE_LUAC
|
|
#include "lbaselib.c"
|
|
#if defined(LUA_COMPAT_BITLIB)
|
|
#include "lbitlib.c"
|
|
#endif
|
|
#include "lcorolib.c"
|
|
#include "ldblib.c"
|
|
#include "liolib.c"
|
|
#include "lmathlib.c"
|
|
#include "loadlib.c"
|
|
#include "loslib.c"
|
|
#include "lstrlib.c"
|
|
#include "ltablib.c"
|
|
#include "lutf8lib.c"
|
|
#include "linit.c"
|
|
#endif
|
|
|
|
/* lua */
|
|
#ifdef MAKE_LUA
|
|
#include "lua.c"
|
|
#endif
|
|
|
|
/* luac */
|
|
#ifdef MAKE_LUAC
|
|
#include "luac.c"
|
|
#endif
|