From 7145f0d380f29d5412bb60c6e954208673263caa Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Wed, 13 Jan 2021 11:04:23 +0700 Subject: [PATCH] Rename NOFORN to MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE. (#217) This lets us get rid of double-negatives, which are confusing, and starts a naming scheme that is easier to see when something is a Maiko flag versus something else. --- inc/version.h | 5 ----- src/foreign.c | 8 ++++++-- src/main.c | 10 ++++++---- src/subr.c | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/inc/version.h b/inc/version.h index 867f69e..1c7ea5e 100644 --- a/inc/version.h +++ b/inc/version.h @@ -207,11 +207,6 @@ error Must specify RELEASE to build Medley. /* Set up defaults */ #define NOETHER 1 -/* Foreign function call support relies upon DLD which - * weren't supported in modern OSes and the GNU DLD - * library hasn't been supported or maintained since - * at least 2006. */ -#define NOFORN #define UNALIGNED_FETCH_OK #define HAS_GETHOSTID #define UNSIGNED unsigned long diff --git a/src/foreign.c b/src/foreign.c index b17b802..17531de 100644 --- a/src/foreign.c +++ b/src/foreign.c @@ -10,7 +10,11 @@ #include "version.h" -#ifndef NOFORN +/* Foreign function call support relies upon DLD which + * weren't supported in modern OSes and the GNU DLD + * library hasn't been supported or maintained since + * at least 2006. */ +#ifdef MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE #include #include @@ -928,4 +932,4 @@ int get_c_basebyte(LispPTR *args) { break; } } -#endif /* NOFORN */ +#endif /* MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE */ diff --git a/src/main.c b/src/main.c index e740460..5a42fab 100644 --- a/src/main.c +++ b/src/main.c @@ -321,13 +321,13 @@ int main(int argc, char *argv[]) extern int TIMER_INTERVAL; char keytyped[255]; extern fd_set LispReadFds; -#ifndef NOFORN +#ifdef MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE if (dld_find_executable(argv[0]) == 0) { perror("Name of executable not found."); } else if (dld_init(dld_find_executable(argv[0])) != 0) { dld_perror("Can't init DLD."); }; -#endif /* NOFORN */ +#endif /* MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE */ #ifdef XWINDOW read_Xoption(&argc, argv); @@ -751,9 +751,11 @@ void print_info_lines() { #ifdef NOVERSION printf("Does not enforce SYSOUT version matching.\n"); #endif /* NOVERSION */ -#ifdef NOFORN +#ifdef MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE + printf("Has foreign-function-call interface.\n"); +#else printf("Has no foreign-function-call interface.\n"); -#endif /* NOFORN */ +#endif /* MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE */ #ifdef NOEUROKBD printf("No support for European keyboards.\n"); #else diff --git a/src/subr.c b/src/subr.c index 4d93c5e..855bec4 100644 --- a/src/subr.c +++ b/src/subr.c @@ -697,7 +697,7 @@ void OP_subrcall(int subr_no, int argnum) { break; } -#ifndef NOFORN +#ifdef MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE /*****************************************/ /* foreign-function-call support subrs */ /*****************************************/ @@ -766,7 +766,7 @@ void OP_subrcall(int subr_no, int argnum) { TopOfStack = smashing_c_fn(args); break; } -#endif /* NOFORN */ +#endif /* MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE */ #ifdef MNW case sb_FILL_IN: {