Made changes to get tomd working as a init program.
[tlb/tomd.git] / include / macros.h
index ef193e8..dd3843f 100644 (file)
@@ -1,6 +1,14 @@
 #ifndef _MACROS_H
 #define _MACROS_H
 
+#include <errno.h>
+
+#define tomd_panic(...) {                                               \
+    printf("[tomd]PANIC ");                                             \
+    printf(__VA_ARGS__);                                                \
+    printf(" errno=%d\n", errno);                                       \
+    for(;;){}                                                           \
+  }
 #define tomc_p(...) {printf("[tomc]      "); printf(__VA_ARGS__); printf("\n");}
 #define tomd_p(...) {printf("[tomd]      "); printf(__VA_ARGS__); printf("\n");}
 #define SCM_ARR(arr, index) (scm_list_ref(arr, scm_from_int(index)))
@@ -13,6 +21,5 @@ SCM name(SCM obj) {                                  \
   }                                                  \
   return scm_call(func_ref, obj, SCM_UNDEFINED);     \
 }
-  
-  
+
 #endif