Mercurial > prosody-hg
comparison util-src/struct.c @ 12575:1f6f05a98fcd
util-src: Remove Lua 5.1 compat macros
Part of #1600
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 01 Jul 2022 21:21:21 +0200 |
| parents | 05c250fa335a |
| children | e1a71e83d430 |
comparison
equal
deleted
inserted
replaced
| 12574:18d33668c5fa | 12575:1f6f05a98fcd |
|---|---|
| 34 | 34 |
| 35 #include "lua.h" | 35 #include "lua.h" |
| 36 #include "lauxlib.h" | 36 #include "lauxlib.h" |
| 37 | 37 |
| 38 | 38 |
| 39 #if (LUA_VERSION_NUM >= 502) | |
| 40 | |
| 41 #define luaL_register(L,n,f) luaL_newlib(L,f) | |
| 42 | |
| 43 #endif | |
| 44 | |
| 45 | 39 |
| 46 /* basic integer type */ | 40 /* basic integer type */ |
| 47 #if !defined(STRUCT_INT) | 41 #if !defined(STRUCT_INT) |
| 48 #define STRUCT_INT long | 42 #define STRUCT_INT long |
| 49 #endif | 43 #endif |
| 390 | 384 |
| 391 | 385 |
| 392 LUALIB_API int luaopen_util_struct (lua_State *L); | 386 LUALIB_API int luaopen_util_struct (lua_State *L); |
| 393 | 387 |
| 394 LUALIB_API int luaopen_util_struct (lua_State *L) { | 388 LUALIB_API int luaopen_util_struct (lua_State *L) { |
| 395 luaL_register(L, "struct", thislib); | 389 luaL_newlib(L, thislib); |
| 396 return 1; | 390 return 1; |
| 397 } | 391 } |
| 398 | 392 |
| 399 | 393 |
| 400 /****************************************************************************** | 394 /****************************************************************************** |
