From d8d1de2dcb25cdf14185b2fead35f2148d9feae7 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 21 Jan 2023 09:36:03 -0600 Subject: [PATCH] Don't compile library loading code on windows if it is disabled. --- CHANGELOG.md | 3 +++ meson.build | 2 +- src/conf/janetconf.h | 6 +++--- src/core/util.c | 8 ++++++++ src/core/util.h | 4 ++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d242f76a..145c8b7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All notable changes to this project will be documented in this file. +## ??? - Unreleased +- Add build-time detection for cygwin. + ## 1.26.0 - 2023-01-07 - Add `ffi/malloc` and `ffi/free`. Useful as tools of last resort. - Add `ffi/jitfn` to allow calling function pointers generated at runtime from machine code. diff --git a/meson.build b/meson.build index 53fc82d4..9da32926 100644 --- a/meson.build +++ b/meson.build @@ -20,7 +20,7 @@ project('janet', 'c', default_options : ['c_std=c99', 'build.c_std=c99', 'b_lundef=false', 'default_library=both'], - version : '1.26.0') + version : '1.26.1') # Global settings janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet') diff --git a/src/conf/janetconf.h b/src/conf/janetconf.h index 9bc39452..666cd01e 100644 --- a/src/conf/janetconf.h +++ b/src/conf/janetconf.h @@ -5,9 +5,9 @@ #define JANET_VERSION_MAJOR 1 #define JANET_VERSION_MINOR 26 -#define JANET_VERSION_PATCH 0 -#define JANET_VERSION_EXTRA "" -#define JANET_VERSION "1.26.0" +#define JANET_VERSION_PATCH 1 +#define JANET_VERSION_EXTRA "-dev" +#define JANET_VERSION "1.26.1-dev" /* #define JANET_BUILD "local" */ diff --git a/src/core/util.c b/src/core/util.c index 4ea500ee..585f0923 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -920,6 +920,13 @@ char *get_processed_name(const char *name) { return ret; } +#if defined(JANET_NO_DYNAMIC_MODULES) + +const char *error_clib(void) { + return "dynamic modules not supported"; +} + +#else #if defined(JANET_WINDOWS) static char error_clib_buf[256]; @@ -967,6 +974,7 @@ void *symbol_clib(HINSTANCE clib, const char *sym) { } } +#endif #endif /* Alloc function macro fills */ diff --git a/src/core/util.h b/src/core/util.h index 6820f5aa..5a4c8808 100644 --- a/src/core/util.h +++ b/src/core/util.h @@ -135,7 +135,7 @@ int janet_gettime(struct timespec *spec); typedef int Clib; #define load_clib(name) ((void) name, 0) #define symbol_clib(lib, sym) ((void) lib, (void) sym, NULL) -#define error_clib() "dynamic libraries not supported" +const char *error_clib(void); #define free_clib(c) ((void) (c), 0) #elif defined(JANET_WINDOWS) #include @@ -150,7 +150,7 @@ typedef void *Clib; #define load_clib(name) dlopen((name), RTLD_NOW) #define free_clib(lib) dlclose((lib)) #define symbol_clib(lib, sym) dlsym((lib), (sym)) -#define error_clib() dlerror() +#define error_clib dlerror #endif char *get_processed_name(const char *name);