summaryrefslogtreecommitdiff
path: root/libmachdev/util.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-02-19 06:16:15 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-02-19 06:16:15 +0000
commit34e3b522eca7e8741cecb7c2241091f181d1bd1f (patch)
tree3b64ac3aa4603539b8f8f384bc39998e29948900 /libmachdev/util.h
parentd4e6a14eb3fad1b43a21214db139db441025baf5 (diff)
parent6fafeb146e9efd59140ea58cebd7dd38ae9a6379 (diff)
Merge branch 'upstream-merged'
Diffstat (limited to 'libmachdev/util.h')
-rw-r--r--libmachdev/util.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/libmachdev/util.h b/libmachdev/util.h
new file mode 100644
index 00000000..1c62b0d6
--- /dev/null
+++ b/libmachdev/util.h
@@ -0,0 +1,35 @@
+#ifndef __UTIL_H__
+#define __UTIL_H__
+
+#include <stdio.h>
+
+#define panic(format, ...) do \
+{ \
+ char buf[1024]; \
+ snprintf (buf, 1024, "devnode: %s", format); \
+ fprintf (stderr , buf, ## __VA_ARGS__); \
+ fflush (stderr); \
+ abort (); \
+} while (0)
+
+#define DEBUG
+
+#ifdef DEBUG
+
+#define debug(format, ...) do \
+{ \
+ char buf[1024]; \
+ snprintf (buf, 1024, "pcnet32: %s: %s\n", __func__, format); \
+ fprintf (stderr , buf, ## __VA_ARGS__); \
+ fflush (stderr); \
+} while (0)
+
+#else
+
+#define debug(format, ...) do {} while (0)
+
+#endif
+
+int linux_to_mach_error (int err);
+
+#endif