[Nickle] nickle: Branch 'master'

Keith Packard keithp at keithp.com
Mon Sep 1 13:21:26 PDT 2025


 lex.l       |    8 +++++---
 main.c      |    7 ++++++-
 meson.build |    4 +++-
 3 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit f7c6b696cc83e27dba99ccf8497f181bdc81cfd5
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Aug 27 15:22:56 2025 -0700

    Don't expect #include to expand macros
    
    The compiler doesn't like using #include FOO_H
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/lex.l b/lex.l
index 6c340e8..253b556 100644
--- a/lex.l
+++ b/lex.l
@@ -13,9 +13,11 @@
 #include	<strings.h>
 #include	<errno.h>
 #ifdef HAVE_LIBREADLINE
-#include	READLINE_H
-#ifdef HISTORY_H
-#include	HISTORY_H
+#ifdef HAVE_LIBEDIT
+#include <readline.h>
+#else
+#include <readline/readline.h>
+#include <readline/history.h>
 #endif
 #endif
     
diff --git a/main.c b/main.c
index 7c9d317..a00d61e 100644
--- a/main.c
+++ b/main.c
@@ -28,7 +28,12 @@
 #endif
 
 #ifdef HAVE_LIBREADLINE
-#include READLINE_H
+#ifdef HAVE_LIBEDIT
+#include <readline.h>
+#else
+#include <readline/readline.h>
+#include <readline/history.h>
+#endif
 #endif
 
 int	stdin_interactive;
diff --git a/meson.build b/meson.build
index b4e9b66..3606e73 100644
--- a/meson.build
+++ b/meson.build
@@ -69,7 +69,8 @@ add_project_arguments(cc.get_supported_arguments(
 link_args = cc.get_supported_link_arguments('-Wl,-E')
 have_extern_syms = link_args != []
 
-if get_option('libedit')
+have_libedit = get_option ('libedit')
+if have_libedit
   readline_dep = dependency('libedit')
   readline_h = '<readline.h>'
   history_h = ''
@@ -184,6 +185,7 @@ conf_data = configuration_data({
 				 'HAVE_VPRINTF': have_vfprintf,
 				 'PACKAGE_BUGREPORT': '"http://nickle.org"',
 				 'READLINE_H': readline_h,
+				 'HAVE_LIBEDIT': have_libedit,
 				 'SIZEOF_UNSIGNED_INT': sizeof_unsigned_int,
 				 'SIZEOF_UNSIGNED_LONG': sizeof_unsigned_long,
 				 'SIZEOF_UNSIGNED_LONG_LONG': sizeof_unsigned_long_long,


More information about the Nickle mailing list