diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-19 05:56:38 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-19 05:56:38 +0100 |
commit | 19796a75ab8ba43b31e230ea169d5383c6392bfc (patch) | |
tree | 3041c5678e06133dd7fcbf2ebf34b6506334f677 /libmachdev/util.h | |
parent | 6b2e5e0d91823c2a6ce5a5cb12ae3d00b82adae7 (diff) | |
parent | 8df772b3c665e663f6f9d2a70f9c691590bd3f91 (diff) |
Merge branch 'dde' into upstream-merged
Diffstat (limited to 'libmachdev/util.h')
-rw-r--r-- | libmachdev/util.h | 35 |
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 |