Commit 86b40907 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

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.
parent 84659a5b
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment