mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
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.
This commit is contained in:
parent
84659a5bb6
commit
86b40907d4
@ -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…
Reference in New Issue
Block a user