diff options
| author | ruki <[email protected]> | 2016-09-18 14:18:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-09-18 14:18:23 +0800 |
| commit | a9b9e12af47b126dd792d07b0ffec4377025e1ba (patch) | |
| tree | 4378ee5570eb3a0fd6cbfe518dff115763e7a5fb | |
| parent | e46c89fc171c7609b946fbf2bc8772577adb77cf (diff) | |
repatch ___iob_func for vs2015
| -rwxr-xr-x | core/src/xmake/machine.c | 14 |
1 files 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 <windows.h> #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 */ |
