Allow the use of native modules when using MinGW.
This commit is contained in:
parent
2519e1a516
commit
4be286cfb2
4 changed files with 15 additions and 2 deletions
|
@ -129,6 +129,8 @@ project "qjsc"
|
|||
files {
|
||||
"qjsc.c"
|
||||
}
|
||||
filter { "action:gmake*", "toolset:gcc" }
|
||||
links { "dl", "pthread" }
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -144,6 +146,8 @@ project "qjs"
|
|||
"qjscalc.js",
|
||||
"qjscalc.c"
|
||||
}
|
||||
filter { "action:gmake*", "toolset:gcc" }
|
||||
links { "dl", "pthread" }
|
||||
|
||||
-- Compile repl.js and save bytecode into repl.c
|
||||
prebuildcommands { "\"%{cfg.buildtarget.directory}/qjsc.exe\" -c -o \"../../repl.c\" -m \"../../repl.js\"" }
|
||||
|
|
4
qjsc.c
4
qjsc.c
|
@ -32,7 +32,11 @@
|
|||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(__MINGW32__)
|
||||
#include "win/getopt.h"
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "cutils.h"
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
#include <limits.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(_WIN32)
|
||||
#if defined(__MINGW32__)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <conio.h>
|
||||
#include <io.h>
|
||||
|
@ -463,7 +466,7 @@ typedef JSModuleDef *(JSInitModuleFunc)(JSContext *ctx,
|
|||
const char *module_name);
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(_MSC_VER)
|
||||
static JSModuleDef *js_module_loader_so(JSContext *ctx,
|
||||
const char *module_name)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
#include <time.h>
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#if defined(__APPLE__)
|
||||
#if defined(_WIN32)
|
||||
#include <timezoneapi.h>
|
||||
#elif defined(__APPLE__)
|
||||
#include <malloc/malloc.h>
|
||||
#include <sys/time.h>
|
||||
#elif defined(__linux__)
|
||||
|
|
Loading…
Add table
Reference in a new issue