fix(build): make vendored libmpack and libmpack-lua build properly

This commit is contained in:
Björn Linse
2021-09-04 17:05:22 +02:00
parent 4ef3c2c2c1
commit 2a08aeff1a
3 changed files with 16 additions and 16 deletions

View File

@@ -15,8 +15,6 @@
* compilation.
*/
#define LUA_LIB
/* for snprintf */
#define _XOPEN_SOURCE 500
#include <limits.h>
#include <stdlib.h>
#include <string.h>
@@ -26,12 +24,11 @@
#include <lua.h>
#include <luaconf.h>
#ifdef MPACK_USE_SYSTEM
# include <mpack.h>
#else
# define MPACK_API static
# include "mpack-src/src/mpack.c"
#endif
#include "nvim/macros.h"
#include "lmpack.h"
#include "rpc.h"
#define UNPACKER_META_NAME "mpack.Unpacker"
#define PACKER_META_NAME "mpack.Packer"
@@ -713,7 +710,7 @@ static void lmpack_unparse_enter(mpack_parser_t *parser, mpack_node_t *node)
node->tok = mpack_pack_nil();
break;
}
/* Fallthrough */
FALLTHROUGH;
default:
{
/* #define FMT */

3
src/mpack/lmpack.h Normal file
View File

@@ -0,0 +1,3 @@
#include <lua.h>
int luaopen_mpack(lua_State *L);