hotfix: a better hinting on non-returning spin function
[lunaix-os.git] / lunaix-os / includes / lunaix / spike.h
index 356e4b392bcca12b28dd5f93b2f56fc81e3c3910..a2a0e21d5f66c1c56e33e2947306fb930d78ca2e 100644 (file)
                                                       : 0)                      \
                              : (31 - __builtin_clz(x)))
 
                                                       : 0)                      \
                              : (31 - __builtin_clz(x)))
 
-#define DO_SPIN                                                                \
-    {                                                                          \
-        volatile int __infloop = 1;                                            \
-        while (__infloop)                                                      \
-            ;                                                                  \
-    }
-
 inline static void noret
 spin()
 {
 inline static void noret
 spin()
 {
-    DO_SPIN
+    volatile int __infloop = 1;
+    while (__infloop)
+        ;
+    __builtin_unreachable();
 }
 
 #ifndef __LUNAIXOS_NASSERT__
 }
 
 #ifndef __LUNAIXOS_NASSERT__
@@ -97,7 +93,7 @@ __assert_fail(const char* expr, const char* file, unsigned int line)
 #define assert(cond) (void)(cond);          // assert nothing
 #define assert_msg(cond, msg) (void)(cond); // assert nothing
 
 #define assert(cond) (void)(cond);          // assert nothing
 #define assert_msg(cond, msg) (void)(cond); // assert nothing
 
-#endif                                      // __LUNAIXOS_NASSERT__
+#endif // __LUNAIXOS_NASSERT__
 
 void noret
 panick(const char* msg);
 
 void noret
 panick(const char* msg);