mirror of
https://github.com/janet-lang/janet
synced 2024-12-25 07:50:27 +00:00
Add :mingw value when getting the OS setting when compiled with mingw.
This commit is contained in:
parent
8ee5942481
commit
a490937cd9
@ -1178,7 +1178,13 @@ static Janet janet_ffi_win64(JanetFFISignature *signature, void *function_pointe
|
||||
|
||||
/* hack to get proper stack placement and avoid clobbering from logic above - shift stack down, otherwise we have issues.
|
||||
* Technically, this writes into 16 bytes of unallocated stack memory */
|
||||
#ifdef JANET_MINGW
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
if (stack_size) memmove(stack - stack_shift, stack, stack_size);
|
||||
#ifdef JANET_MINGW
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
switch (signature->variant) {
|
||||
default:
|
||||
|
@ -118,6 +118,7 @@ JANET_CORE_FN(os_which,
|
||||
"(os/which)",
|
||||
"Check the current operating system. Returns one of:\n\n"
|
||||
"* :windows\n\n"
|
||||
"* :mingw\n\n"
|
||||
"* :macos\n\n"
|
||||
"* :web - Web assembly (emscripten)\n\n"
|
||||
"* :linux\n\n"
|
||||
@ -130,6 +131,8 @@ JANET_CORE_FN(os_which,
|
||||
(void) argv;
|
||||
#if defined(JANET_OS_NAME)
|
||||
return janet_ckeywordv(janet_stringify(JANET_OS_NAME));
|
||||
#elif defined(JANET_MINGW)
|
||||
return janet_ckeywordv("mingw");
|
||||
#elif defined(JANET_WINDOWS)
|
||||
return janet_ckeywordv("windows");
|
||||
#elif defined(JANET_APPLE)
|
||||
@ -445,7 +448,9 @@ typedef struct {
|
||||
static JanetEVGenericMessage janet_proc_wait_subr(JanetEVGenericMessage args) {
|
||||
JanetProc *proc = (JanetProc *) args.argp;
|
||||
WaitForSingleObject(proc->pHandle, INFINITE);
|
||||
GetExitCodeProcess(proc->pHandle, (LPDWORD) &args.tag);
|
||||
DWORD exitcode = 0;
|
||||
GetExitCodeProcess(proc->pHandle, &exitcode);
|
||||
args.tag = (int32_t) exitcode;
|
||||
return args;
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,11 @@ extern "C" {
|
||||
#define JANET_MSVC
|
||||
#endif
|
||||
|
||||
/* Check Mingw 32-bit and 64-bit */
|
||||
#ifdef __MINGW32__
|
||||
#define JANET_MINGW
|
||||
#endif
|
||||
|
||||
/* Check 64-bit vs 32-bit */
|
||||
#if ((defined(__x86_64__) || defined(_M_X64)) \
|
||||
&& (defined(JANET_POSIX) || defined(JANET_WINDOWS))) \
|
||||
|
@ -144,7 +144,7 @@
|
||||
(assert (< 1000 1e23) "greater than immediate 2")
|
||||
|
||||
# os/execute with environment variables
|
||||
(assert (= 0 (os/execute [(dyn :executable) "-e" "(+ 1 2 3)"] :pe {"HELLO" "WORLD"})) "os/execute with env")
|
||||
(assert (= 0 (os/execute [(dyn :executable) "-e" "(+ 1 2 3)"] :pe (merge (os/environ) {"HELLO" "WORLD"}))) "os/execute with env")
|
||||
|
||||
# Regression #638
|
||||
(compwhen
|
||||
|
Loading…
Reference in New Issue
Block a user