From a9b9e12af47b126dd792d07b0ffec4377025e1ba Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 18 Sep 2016 14:18:23 +0800 Subject: repatch ___iob_func for vs2015 --- core/src/xmake/machine.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index dd300e3a7..2f0791834 100755 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -36,11 +36,6 @@ # include #endif -// patch for linking error on vs2015: unresolved external symbol ___iob_func -#if defined(TB_COMPILER_IS_MSVC) && _MSC_VER >= 1900 -# pragma comment(lib, "legacy_stdio_definitions.lib") -#endif - /* ////////////////////////////////////////////////////////////////////////////////////// * types */ @@ -157,6 +152,15 @@ static luaL_Reg const g_process_functions[] = , { tb_null, tb_null } }; +// patch for linking error on vs2015: unresolved external symbol ___iob_func, fprintf, fscanf +#if defined(TB_COMPILER_IS_MSVC) && _MSC_VER >= 1900 +# pragma comment(lib, "legacy_stdio_definitions.lib") +extern "C" +{ + FILE __iob_func[3] = { *stdin, *stdout, *stderr }; +} +#endif + /* ////////////////////////////////////////////////////////////////////////////////////// * private implementation */ -- cgit v1.3.1