ref: e52b78fcea532d84f83c88a35d4844089a66e42d
parent: 065e6150c3b727a3dc15647609e6a4904c79ee18
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Dec 26 23:10:53 EST 2024
move static_assert define to plan9-specific headers
--- a/3rd/fn.h
+++ b/3rd/fn.h
@@ -137,17 +137,6 @@
}
// sanity checks!
-
-#if !defined(static_assert)
-#define static_assert_cat(a,b) a##b
-#define static_assert_name(line) static_assert_cat(static_assert_,line)
-#define static_assert(must_be_true, message) \
- static const void *static_assert_name(__LINE__) \
- [must_be_true ? 2 : -1] = { \
- message, \
- static_assert_name(__LINE__) }
-#endif
-
static_assert(Tix_base_bitmap + Tix_width_bitmap == 64,
"index fields must fill a 64 bit word");
--- a/plan9/platform.h
+++ b/plan9/platform.h
@@ -8,6 +8,16 @@
#ifdef NDEBUG
#undef assert
#define assert(x)
+#define static_assert(a,b)
+#else
+#define static_assert_cat(a, b) a##b
+#define static_assert_name(line) static_assert_cat(static_assert_, line)
+#define static_assert(must_be_true, message) \
+ static const void *static_assert_name(__LINE__) \
+ [must_be_true ? 2 : -1] = { \
+ message, \
+ static_assert_name(__LINE__), \
+ }
#endif
#define __os_name__ "plan9"