Skip to content

Commit e0e33b1

Browse files
committed
luzer: compat
1 parent b9c045b commit e0e33b1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

luzer/compat.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
#include "lualib.h"
33
#include "lauxlib.h"
44

5-
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM == 501
5+
/* PUC-Rio Lua uses lconfig_h as include guard for luaconf.h,
6+
* LuaJIT uses luaconf_h. If you use PUC-Rio's include files
7+
* but LuaJIT's library, you will need to define the macro
8+
* COMPAT52_IS_LUAJIT yourself! */
9+
#if !defined(COMPAT52_IS_LUAJIT) && defined(luaconf_h)
10+
#define COMPAT52_IS_LUAJIT
11+
#endif
12+
13+
#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM == 501 && !defined(COMPAT52_IS_LUAJIT))
614

715
static int
816
countlevels(lua_State *L) {

luzer/compat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#ifndef LUZER_COMPAT_H_
22
#define LUZER_COMPAT_H_
33

4+
#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM == 501 && !defined(COMPAT52_IS_LUAJIT))
5+
46
void luaL_traceback(lua_State *L, lua_State *L1,
57
const char *msg, int level);
68

9+
#endif
10+
711
#endif // LUZER_COMPAT_H_

0 commit comments

Comments
 (0)