Complete (almost!) printf fmt support
[lunaix-os.git] / lunaix-os / includes / lunaix / spike.h
index fa4e797ddad4898649f9a290832c370ce8a774b1..7e50693bc6fa37e77467078ceb63505c422d121b 100644 (file)
 // 获取v最近的最小k倍数
 #define ROUNDDOWN(v, k)     ((v) & ~((k) - 1))
 
-static void inline spin() {
+inline static void spin() {
     while(1);
 }
 
+#ifdef __LUNAIXOS_DEBUG__
+#define assert(cond)                                  \
+    if (!(cond)) {                                    \
+        __assert_fail(#cond, __FILE__, __LINE__);     \
+    }
+void __assert_fail(const char* expr, const char* file, unsigned int line) __attribute__((noinline, noreturn));
+#else
+#define assert(cond) //nothing
+#endif
+
+
+
 #endif /* __LUNAIX_SPIKE_H */