summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcore/src/xmake/machine.c14
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
*/