DPRINTF(): Fix format, handle non-gcc, simplify.

Add C99-required 1st parameter.  Disable for for non-gcc.  Simplify.
GNU extension #define DPRINTF(<no 1st arg>...) -> GNU ext ,##__VA_ARGS__.
Fix __LINE__ format %ld -> %d.
vmware
Hallvard B Furuseth 14 years ago
parent 84659a5bb6
commit 86b40907d4
  1. 13
      libraries/libmdb/mdb.c

@ -25,14 +25,15 @@
#include "mdb.h"
#define DEBUG
#ifndef DEBUG
#define DEBUG 1
#endif
#ifdef DEBUG
# define DPRINTF(...) do { fprintf(stderr, "%s:%d: ", __func__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); } while(0)
#if (DEBUG +0) && defined(__GNUC__)
# define DPRINTF(fmt, ...) \
fprintf(stderr, "%s:%d: " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
#else
# define DPRINTF(...)
# define DPRINTF(...) ((void) 0)
#endif
#define PAGESIZE 4096

Loading…
Cancel
Save