summaryrefslogtreecommitdiff
path: root/libmisc/tests/test_macro.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-05-31 11:41:42 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-02 17:03:08 -0600
commitcc8b1b019d2b1d9ff2f1b9fd0aab0cae6d7cf96e (patch)
treeca8a875b172f01afc97164c8462ab7549aae97e9 /libmisc/tests/test_macro.c
parentce8ae41d677875adb45d99c351bcba108fb82a44 (diff)
wip: libmisc: Move FOREACH into wrap-cclukeshu/wrap-foreach
Diffstat (limited to 'libmisc/tests/test_macro.c')
-rw-r--r--libmisc/tests/test_macro.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmisc/tests/test_macro.c b/libmisc/tests/test_macro.c
index 6810005..95a9f32 100644
--- a/libmisc/tests/test_macro.c
+++ b/libmisc/tests/test_macro.c
@@ -23,6 +23,7 @@
/** XUNDER is 0 through `OVER` inclusive. */
#define XOVER XUNDER X(OVER)
+#ifndef __LIBMISC_ENHANCED_CPP__
static char *without_spaces(const char *in) {
char *out = strdup(in);
for (size_t i = 0; out[i]; i++)
@@ -31,6 +32,7 @@ static char *without_spaces(const char *in) {
out[j] = out[j+1];
return out;
}
+#endif
int main() {
printf("== LM_NEXT_POWER_OF_2 =====================================\n");
@@ -118,6 +120,7 @@ int main() {
}
/* Test that it breaks at documented_limit+1 tuples. */
+#ifndef __LIBMISC_ENHANCED_CPP__
{
#define X(n) , n
#define FN(n) n
@@ -136,6 +139,7 @@ int main() {
test_assert(strcmp(act_suffix, exp_suffix) == 0);
free(act_suffix);
}
+#endif
printf("== LM_FOREACH_TUPLE =======================================\n");
/* Basic test. */
@@ -159,6 +163,7 @@ int main() {
}
/* Test that it breaks at documented_limit+1 tuples. */
+#ifndef __LIBMISC_ENHANCED_CPP__
{
#define X(n) (n)
#define FN(n) n
@@ -177,6 +182,7 @@ int main() {
test_assert(strcmp(act_suffix, exp_suffix) == 0);
free(act_suffix);
}
+#endif
printf("== LM_DEFAPPEND ===========================================\n");
LM_DEFAPPEND(mylist, a);