summaryrefslogtreecommitdiff
path: root/libmachdev/util.h
blob: 6fb1db2841c3329c0b8820c0e567d8a33c47ebf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#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

#endif