diff options
| author | Philipp Janda <siffiejoe@gmx.net> | 2017-09-16 12:45:00 +0200 |
|---|---|---|
| committer | Philipp Janda <siffiejoe@gmx.net> | 2017-09-16 12:45:00 +0200 |
| commit | f76fb008c8297dc0a9de579c20cfe57480890688 (patch) | |
| tree | 5d2301a733f2210207e85dfc8218bd0e8d28174e /c-api | |
| parent | 7fc7aba7defda15b7f9c56282e585eb91379fe3b (diff) | |
| parent | c0a59dda383c37fdeb786de7b3fc4e58e2ab886d (diff) | |
| download | lua-compat-5.3-f76fb008c8297dc0a9de579c20cfe57480890688.tar.gz lua-compat-5.3-f76fb008c8297dc0a9de579c20cfe57480890688.tar.bz2 lua-compat-5.3-f76fb008c8297dc0a9de579c20cfe57480890688.zip | |
Merge branch 'luaL_Stream' of https://github.com/daurnimator/lua-compat-5.3 into daurnimator-luaL_Stream
Diffstat (limited to 'c-api')
| -rw-r--r-- | c-api/compat-5.3.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h index 6c76930..a5b10d2 100644 --- a/c-api/compat-5.3.h +++ b/c-api/compat-5.3.h | |||
| @@ -87,6 +87,9 @@ extern "C" { | |||
| 87 | #ifndef LUA_OPLE | 87 | #ifndef LUA_OPLE |
| 88 | # define LUA_OPLE 2 | 88 | # define LUA_OPLE 2 |
| 89 | #endif | 89 | #endif |
| 90 | #ifndef LUA_FILEHANDLE | ||
| 91 | # define LUA_FILEHANDLE "FILE*" | ||
| 92 | #endif | ||
| 90 | 93 | ||
| 91 | /* LuaJIT/Lua 5.1 does not have the updated | 94 | /* LuaJIT/Lua 5.1 does not have the updated |
| 92 | * error codes for thread status/function returns (but some patched versions do) | 95 | * error codes for thread status/function returns (but some patched versions do) |
| @@ -112,6 +115,15 @@ typedef struct luaL_Buffer_53 { | |||
| 112 | } luaL_Buffer_53; | 115 | } luaL_Buffer_53; |
| 113 | #define luaL_Buffer luaL_Buffer_53 | 116 | #define luaL_Buffer luaL_Buffer_53 |
| 114 | 117 | ||
| 118 | /* | ||
| 119 | * In PUC-Rio 5.1, userdata is a simple FILE* | ||
| 120 | * In LuaJIT, it's a struct where the first member is a FILE* | ||
| 121 | * We can't support the `closef` member | ||
| 122 | */ | ||
| 123 | typedef struct luaL_Stream { | ||
| 124 | FILE *f; | ||
| 125 | } luaL_Stream; | ||
| 126 | |||
| 115 | #define lua_absindex COMPAT53_CONCAT(COMPAT53_PREFIX, _absindex) | 127 | #define lua_absindex COMPAT53_CONCAT(COMPAT53_PREFIX, _absindex) |
| 116 | COMPAT53_API int lua_absindex (lua_State *L, int i); | 128 | COMPAT53_API int lua_absindex (lua_State *L, int i); |
| 117 | 129 | ||
