--- misc/debug.h.orig	2023-07-02 02:02:58.000000000 +0800
+++ misc/debug.h	2024-09-07 22:31:53.000000000 +0800
@@ -99,8 +99,8 @@
   #define static_assert_opt( expr, string ) \
 		  assert( expr )
 #elif defined( __GNUC__ ) && \
-	  ( ( __GNUC__ == 4 && __GNUC_MINOR__ >= 7 && defined( static_assert ) ) || \
-		( __GNUC__ >= 5 ) ) 
+	  ( ( __GNUC__ == 4 && __GNUC_MINOR__ >= 7) || \
+		( __GNUC__ >= 5 ) ) && defined( static_assert )
   /* Supposedly built into gcc 4.5 and above (as usual for new gcc features
 	 this isn't really documented, but web comments indicate that it should 
 	 be present in 4.5 and above), however trying this with 4.5 produces
@@ -123,7 +123,7 @@
 	 leave it for now */
   #define static_assert_opt( expr, string ) \
 		  assert( expr )
-#elif defined( __clang__ )
+#elif defined( __clang__ ) || ( defined( __GNUC__ ) && !defined( static_assert ) )
   /* Supported in LLVM/clang, however it's present using the C11 
      _Static_assert name rather than the C++11 static_assert one.  Some 
 	 assert.h's will map static_assert to _Static_assert, but since this 
