Skip to content

Commit

Permalink
avoid MSVC build error
Browse files Browse the repository at this point in the history
```
Microsoft (R) Incremental Linker Version 14.00.24241.7
Copyright (C) Microsoft Corporation.  All rights reserved.
io.def : error LNK2001: unresolved external symbol luaopen_compat53_io
compat53/io.lib : fatal error LNK1120: 1 unresolved externals
Error: Build error: Failed compiling module compat53/io.dll
```
  • Loading branch information
hishamhm committed Aug 29, 2024
1 parent 0c9acd4 commit ccda801
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lprefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,21 +242,24 @@ static void createmeta (lua_State *L);
# undef LUA_FILEHANDLE
# define LUA_FILEHANDLE COMPAT53_LUA_PFILEHANDLE

LUAMOD_API int luaopen_compat53_io (lua_State *L) {
luaL_Reg const funcs[] = {

/* for PUC-Rio Lua 5.1 only */
# if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM == 501 && !defined(LUA_JITLIBNAME)

LUAMOD_API int luaopen_compat53_io (lua_State *L) {
luaL_Reg const funcs[] = {
{ "popen", io_popen },
{ "type", io_ptype },

# endif /* for PUC-Rio Lua 5.1 only */

{ NULL, NULL }
};
luaL_newlib(L, funcs);
createmeta(L);
return 1;
}

# endif /* for PUC-Rio Lua 5.1 only */

/* fake CLANG feature detection on other compilers */
# ifndef __has_attribute
Expand Down

0 comments on commit ccda801

Please sign in to comment.