From b0db2effc7ce23700e3aa51e521820d63e91046b Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Thu, 15 Jan 2026 10:22:01 -0500 Subject: [PATCH] library is now C++ compatible :^) --- include/nickel/arena.h | 14 ++++++++++++++ include/nickel/argparse.h | 10 ++++++++++ include/nickel/bitman.h | 10 ++++++++++ include/nickel/buf.h | 10 ++++++++++ include/nickel/ctassert.h | 10 ++++++++++ include/nickel/defer.h | 10 ++++++++++ include/nickel/hashmap.h | 10 ++++++++++ include/nickel/ini.h | 10 ++++++++++ include/nickel/io.h | 10 ++++++++++ include/nickel/linkedlist.h | 8 ++++++++ include/nickel/log.h | 10 ++++++++++ include/nickel/refcnt.h | 10 ++++++++++ include/nickel/result.h | 10 ++++++++++ include/nickel/ring_spsc.h | 10 ++++++++++ include/nickel/span.h | 10 ++++++++++ include/nickel/threadpool.h | 10 ++++++++++ include/nickel/timeutil.h | 10 ++++++++++ include/nickel/version.h | 10 ++++++++++ include/nickel/xalloc.h | 10 ++++++++++ 19 files changed, 192 insertions(+) diff --git a/include/nickel/arena.h b/include/nickel/arena.h index e69de29..d32a0ad 100644 --- a/include/nickel/arena.h +++ b/include/nickel/arena.h @@ -0,0 +1,14 @@ +#ifndef __NICKEL_ARENA_H_ +#define __NICKEL_ARENA_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + +#endif /* __NICKEL_ARENA_H_ */ \ No newline at end of file diff --git a/include/nickel/argparse.h b/include/nickel/argparse.h index da1b842..c440bf0 100644 --- a/include/nickel/argparse.h +++ b/include/nickel/argparse.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_ARGPARSE_H_ #define __NICKEL_ARGPARSE_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_ARGPARSE_H_ */ \ No newline at end of file diff --git a/include/nickel/bitman.h b/include/nickel/bitman.h index ca35a63..82bec2b 100644 --- a/include/nickel/bitman.h +++ b/include/nickel/bitman.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_BITMAN_H_ #define __NICKEL_BITMAN_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_BITMAN_H_ */ \ No newline at end of file diff --git a/include/nickel/buf.h b/include/nickel/buf.h index 689d71b..b094eb1 100644 --- a/include/nickel/buf.h +++ b/include/nickel/buf.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_BUF_H_ #define __NICKEL_BUF_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_BUF_H_ */ \ No newline at end of file diff --git a/include/nickel/ctassert.h b/include/nickel/ctassert.h index bc82574..4104ea2 100644 --- a/include/nickel/ctassert.h +++ b/include/nickel/ctassert.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_CTASSERT_H_ #define __NICKEL_CTASSERT_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_CTASSERT_H_ */ \ No newline at end of file diff --git a/include/nickel/defer.h b/include/nickel/defer.h index 13d7afe..fdf451f 100644 --- a/include/nickel/defer.h +++ b/include/nickel/defer.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_DEFER_H_ #define __NICKEL_DEFER_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_DEFER_H_ */ \ No newline at end of file diff --git a/include/nickel/hashmap.h b/include/nickel/hashmap.h index f63bb37..829bf0f 100644 --- a/include/nickel/hashmap.h +++ b/include/nickel/hashmap.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_HASHMAP_H_ #define __NICKEL_HASHMAP_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_HASHMAP_H_ */ \ No newline at end of file diff --git a/include/nickel/ini.h b/include/nickel/ini.h index bb4d47f..4ea45ab 100644 --- a/include/nickel/ini.h +++ b/include/nickel/ini.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_INI_H_ #define __NICKEL_INI_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_INI_H_ */ \ No newline at end of file diff --git a/include/nickel/io.h b/include/nickel/io.h index c60f0f2..f5afdd3 100644 --- a/include/nickel/io.h +++ b/include/nickel/io.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_IO_H_ #define __NICKEL_IO_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_IO_H_ */ \ No newline at end of file diff --git a/include/nickel/linkedlist.h b/include/nickel/linkedlist.h index fcaa565..5ac4121 100644 --- a/include/nickel/linkedlist.h +++ b/include/nickel/linkedlist.h @@ -6,6 +6,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct ni_list_node { struct ni_list_node* next; struct ni_list_node* prev; @@ -65,4 +69,8 @@ static inline ni_list_node* ni_list__get_back(ni_list* l) { #define NI_LIST_CONTAINER_OF(ptr, type, member) \ ((type*)((uint8_t*)(ptr) - offsetof(type, member))) +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_LINKEDLIST_H_ */ \ No newline at end of file diff --git a/include/nickel/log.h b/include/nickel/log.h index 70e4d90..c8dde18 100644 --- a/include/nickel/log.h +++ b/include/nickel/log.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_LOG_H_ #define __NICKEL_LOG_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_LOG_H_ */ \ No newline at end of file diff --git a/include/nickel/refcnt.h b/include/nickel/refcnt.h index ac1f7aa..c3b045e 100644 --- a/include/nickel/refcnt.h +++ b/include/nickel/refcnt.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_REFCNT_H_ #define __NICKEL_REFCNT_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_REFCNT_H_ */ \ No newline at end of file diff --git a/include/nickel/result.h b/include/nickel/result.h index cdeb3bf..d5aa486 100644 --- a/include/nickel/result.h +++ b/include/nickel/result.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_RESULT_H_ #define __NICKEL_RESULT_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_RESULT_H_ */ \ No newline at end of file diff --git a/include/nickel/ring_spsc.h b/include/nickel/ring_spsc.h index 29ae2be..bdf9a5b 100644 --- a/include/nickel/ring_spsc.h +++ b/include/nickel/ring_spsc.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_RINGSPSC_H_ #define __NICKEL_RINGSPSC_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_RINGSPSC_H_ */ \ No newline at end of file diff --git a/include/nickel/span.h b/include/nickel/span.h index 2cfe260..9004869 100644 --- a/include/nickel/span.h +++ b/include/nickel/span.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_SPAN_H_ #define __NICKEL_SPAN_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_SPAN_H_ */ \ No newline at end of file diff --git a/include/nickel/threadpool.h b/include/nickel/threadpool.h index 0f06980..fb1ddc7 100644 --- a/include/nickel/threadpool.h +++ b/include/nickel/threadpool.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_THREADPOOL_H_ #define __NICKEL_THREADPOOL_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_THREADPOOL_H_ */ \ No newline at end of file diff --git a/include/nickel/timeutil.h b/include/nickel/timeutil.h index 8680f09..e4d3aa0 100644 --- a/include/nickel/timeutil.h +++ b/include/nickel/timeutil.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_TIMEUTIL_H_ #define __NICKEL_TIMEUTIL_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_TIMEUTIL_H_ */ \ No newline at end of file diff --git a/include/nickel/version.h b/include/nickel/version.h index 6b33a6e..74059d5 100644 --- a/include/nickel/version.h +++ b/include/nickel/version.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_VERSION_H_ #define __NICKEL_VERSION_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_VERSION_H_ */ \ No newline at end of file diff --git a/include/nickel/xalloc.h b/include/nickel/xalloc.h index f7ffbe2..4149f78 100644 --- a/include/nickel/xalloc.h +++ b/include/nickel/xalloc.h @@ -1,4 +1,14 @@ #ifndef __NICKEL_XALLOC_H_ #define __NICKEL_XALLOC_H_ +#ifdef __cplusplus +extern "C" { +#endif + +/* header contents */ + +#ifdef __cplusplus +} +#endif + #endif /* __NICKEL_XALLOC_H_ */ \ No newline at end of file