From 14ae4b16b1feefc08808d06979042d355fc77e18 Mon Sep 17 00:00:00 2001 From: Eczbek Date: Fri, 16 Jan 2026 08:37:45 -0500 Subject: [PATCH 1/3] Wrap `$define_static_array` in parentheses --- include/rsl/macro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rsl/macro b/include/rsl/macro index 37e7e37..79da76a 100644 --- a/include/rsl/macro +++ b/include/rsl/macro @@ -38,9 +38,9 @@ //! Workaround for expansion statements in GCC #if $compiler_is(GCC) -# define $define_static_array(...) [:std::meta::reflect_constant_array(__VA_ARGS__):] +# define $define_static_array(...) [:::std::meta::reflect_constant_array(__VA_ARGS__):] #else -# define $define_static_array(...) std::define_static_array(__VA_ARGS__) +# define $define_static_array(...) (::std::define_static_array(__VA_ARGS__)) #endif /** Applies `macro` to every element and inserts delimiters produced by `delim` between elements From be5e8b73ae5c779e8c4308d3d533fbc1e6bc90a7 Mon Sep 17 00:00:00 2001 From: Eczbek Date: Fri, 16 Jan 2026 09:06:25 -0500 Subject: [PATCH 2/3] Move details of `$define_static_array` to separate header --- include/rsl/_impl/macro/define_static_array.hpp | 10 ++++++++++ include/rsl/macro | 7 ++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 include/rsl/_impl/macro/define_static_array.hpp diff --git a/include/rsl/_impl/macro/define_static_array.hpp b/include/rsl/_impl/macro/define_static_array.hpp new file mode 100644 index 0000000..9832a16 --- /dev/null +++ b/include/rsl/_impl/macro/define_static_array.hpp @@ -0,0 +1,10 @@ +#pragma once +#include + +#include "compiler.hpp" + +#if RSL_COMPILER == RSL_COMPILER_GCC +# define RSL_DEFINE_STATIC_ARRAY(...) [:::std::meta::reflect_constant_array(__VA_ARGS__):] +#else +# define RSL_DEFINE_STATIC_ARRAY(...) (::std::define_static_array(__VA_ARGS__)) +#endif diff --git a/include/rsl/macro b/include/rsl/macro index 79da76a..2efa908 100644 --- a/include/rsl/macro +++ b/include/rsl/macro @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -37,11 +38,7 @@ #define $enable_if(...) RSL_ENABLE_IF(__VA_ARGS__) //! Workaround for expansion statements in GCC -#if $compiler_is(GCC) -# define $define_static_array(...) [:::std::meta::reflect_constant_array(__VA_ARGS__):] -#else -# define $define_static_array(...) (::std::define_static_array(__VA_ARGS__)) -#endif +#define $define_static_array(...) RSL_DEFINE_STATIC_ARRAY(__VA_ARGS__) /** Applies `macro` to every element and inserts delimiters produced by `delim` between elements * @param macro function-like macro applied to every element From 778013562a4caf1cb16a4e7e27f4a0d705c4c4ec Mon Sep 17 00:00:00 2001 From: Eczbek Date: Fri, 16 Jan 2026 10:06:57 -0500 Subject: [PATCH 3/3] Rename detail header, fix some comments --- .../{define_static_array.hpp => compat.hpp} | 0 include/rsl/_impl/macro/compiler.hpp | 3 +-- include/rsl/macro | 22 ++++++++++--------- 3 files changed, 13 insertions(+), 12 deletions(-) rename include/rsl/_impl/macro/{define_static_array.hpp => compat.hpp} (100%) diff --git a/include/rsl/_impl/macro/define_static_array.hpp b/include/rsl/_impl/macro/compat.hpp similarity index 100% rename from include/rsl/_impl/macro/define_static_array.hpp rename to include/rsl/_impl/macro/compat.hpp diff --git a/include/rsl/_impl/macro/compiler.hpp b/include/rsl/_impl/macro/compiler.hpp index fc01eb9..ba6505e 100644 --- a/include/rsl/_impl/macro/compiler.hpp +++ b/include/rsl/_impl/macro/compiler.hpp @@ -1,5 +1,4 @@ #pragma once -#include #define RSL_COMPILER_UNKNOWN 0 #define RSL_COMPILER_CLANG 1 @@ -49,4 +48,4 @@ #else # define RSL_STDLIB RSL_STDLIB_UNKNOWN # define RSL_STDLIB_VERSION 0 -#endif \ No newline at end of file +#endif diff --git a/include/rsl/macro b/include/rsl/macro index 2efa908..6e6900f 100644 --- a/include/rsl/macro +++ b/include/rsl/macro @@ -3,38 +3,36 @@ #include #include #include -#include +#include #include #include // compile environment checks /** - * @param compiler: one of UNKNOWN, CLANG, GCC, MSVC + * @param compiler one of UNKNOWN, CLANG, GCC, MSVC */ #define $compiler_is(compiler) (RSL_COMPILER == RSL_COMPILER_##compiler) /** - * @param stdlib: one of UNKNOWN, LIBCXX, GLIBCXX, MSVC + * @param stdlib one of UNKNOWN, LIBCXX, GLIBCXX, MSVC */ #define $stdlib_is(stdlib) (RSL_STDLIB == RSL_STDLIB_##stdlib) /** - * @param os: one of UNKNOWN, WINDOWS, LINUX, MAC, FREEBSD, ANDROID, IOS + * @param os one of UNKNOWN, WINDOWS, LINUX, MAC, FREEBSD, ANDROID, IOS */ #define $os_is(os) (RSL_OS == RSL_OS_##os) -/// feature macro helper +/// Feature macro helper #define $uses_opt(x) USES_OPT(x) /** - * @param: one of always, never + * @param opt one of always, never */ -#define $inline(...) RSL_INLINE(__VA_ARGS__) +#define $inline(opt) RSL_INLINE(opt) -/** Enable this overload if expr evaluates to true. Clang only. - * @param expr - */ +/// Enable this overload if a given expression evaluates to true. Clang only. #define $enable_if(...) RSL_ENABLE_IF(__VA_ARGS__) //! Workaround for expansion statements in GCC @@ -59,6 +57,10 @@ */ #define $for_each(macro, ...) RSL_IMPL_FOR_EACH_DELIM(macro, RSL_IMPL_DELIM_NONE, __VA_ARGS__) +/** + * @param op one of push, pop, disable, error + * @param ... optional arguments +*/ #define $diagnostics(op, ...) RSL_DIAG_##op (__VA_ARGS__) /// Introduces an explicit template region