From 18e21627107914868245b66a0d8afe351c82976c Mon Sep 17 00:00:00 2001 From: Jesper Wramberg Date: Sat, 11 Apr 2026 16:43:48 +0200 Subject: [PATCH] Apply extern-C and related compatibility updates --- include/slash/slash.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/slash/slash.h b/include/slash/slash.h index 4a5b0e4..a6bc809 100644 --- a/include/slash/slash.h +++ b/include/slash/slash.h @@ -31,6 +31,10 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif + /* Configuration */ #define SLASH_SHOW_MAX 25 /* Maximum number of commands to list */ #define SLASH_ARG_MAX 16 /* Maximum number of arguments, including command name */ @@ -46,12 +50,12 @@ __attribute__((section(".slash." # _ident), used, aligned(sizeof(long)))) \ struct slash_command _ident = { \ .name = #_name, \ - .parent = _group, \ .func = _func, \ .args = _args, \ .help = _help, \ .flags = _flags, \ .context = _context, \ + .parent = _group, \ } /* Top-level commands */ @@ -512,4 +516,8 @@ void slash_inhibit_exit(struct slash *slash, bool inhibit); */ void slash_set_privileged(struct slash *slash, bool privileged); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* _SLASH_H_ */