From 682265132ddb92f6fbf7a0bd9663658d538c4200 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 6 Aug 2024 13:42:55 -0600 Subject: [PATCH] fix foreign test for i3nt (#860) For some build environments, `_WIN32` is needed in "foreign3.c" (as in other "foreign*.c" files) instead of `WIN32` without the leading underscore. Also, simplify "mats/build.zuo" by using `_WIN32` in "ftype.h". --- mats/build.zuo | 3 --- mats/foreign3.c | 6 +++--- mats/ftype.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mats/build.zuo b/mats/build.zuo index 5331c7212..d73a95603 100644 --- a/mats/build.zuo +++ b/mats/build.zuo @@ -363,9 +363,6 @@ "cc"))) (cons "FTYPE_CFLAGS" (build-shell (or (lookup 'CPPFLAGS) "") - (if (eq? 'windows (system-type)) - "-DWIN32" - "") (or (lookup 'mdinclude) "") (or (lookup 'CFLAGS) "") (or (lookup 'mdcflags) ""))) diff --git a/mats/foreign3.c b/mats/foreign3.c index d84038f90..60777ebec 100644 --- a/mats/foreign3.c +++ b/mats/foreign3.c @@ -17,7 +17,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -178,7 +178,7 @@ EXPORT char Srvtest_char(ptr code, ptr x1) { return (*((char (*)(ptr))Sforeign_callable_entry_point(code)))(x1); } -#ifdef WIN32 +#ifdef _WIN32 EXPORT int __stdcall sum_stdcall(int a, int b) { return a + b; } @@ -208,7 +208,7 @@ EXPORT com_instance_t *get_com_instance(void) { com_instance.data = -31; return &com_instance; } -#endif /* WIN32 */ +#endif /* _WIN32 */ /* foreign_callable example adapted from foreign.stex */ typedef void (*CB)(char); diff --git a/mats/ftype.h b/mats/ftype.h index c56a682d8..5a8366232 100644 --- a/mats/ftype.h +++ b/mats/ftype.h @@ -31,7 +31,7 @@ typedef unsigned long long uint64_t; #endif -#ifdef WIN32 +#ifdef _WIN32 #define EXPORT extern __declspec (dllexport) #else #define EXPORT extern