Browse Source

Redefine abort so clang is happy.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 8 years ago
parent
commit
c636ffe937
1 changed files with 4 additions and 1 deletions
  1. 4 1
      sys/include/libc.h

+ 4 - 1
sys/include/libc.h

@@ -12,7 +12,10 @@
 
 #define	nelem(x)	(sizeof(x)/sizeof((x)[0]))
 #define	offsetof(s, m)	(uintptr_t)(&(((s*)0)->m))
-#define	assert(x)	if(x){}else _assert("x")
+#define	assert(x)	if(x){}else _assert(#x)
+
+extern void (*_abort)(void);
+#define abort() if(_abort){_abort();}else{while(*(volatile int*)0);}
 
 /*
  * mem routines