On 22/01/15 06:13, leo(a)yuriev.ru wrote:
> I unexpectedly detected that the variadic macro feature of C99 was
> already used in OpenLDAP 2.4 ;)
Look a bit closer:
> grep -R __VA_ARGS__ *
> build/ltmain.sh:# define DEBUG(format, ...) fprintf(stderr, format,
> __VA_ARGS__)
> contrib/ldapc++/ltmain.sh:# define DEBUG(format, ...) fprintf(stderr,
> format, __VA_ARGS__)
ltmain.sh is a shell/code library generated by GNU libtool.
Lots of stuff in there which we do not use.
> libraries/liblmdb/mdb.c: fprintf(stderr, "%s:%d " fmt "\n",
> mdb_func_, __LINE__, __VA_ARGS__)
> servers/slapd/back-bdb/back-bdb.h:#define
> BDB_LOG_PRINTF(env,txn,fmt,...)
> (env)->log_printf((env),(txn),(fmt),__VA_ARGS__)
> servers/slapd/back-bdb/back-bdb.h:#define
> BDB_LOG_PRINTF(env,txn,fmt,...)
> __db_logmsg((env),(txn),"DIAGNOSTIC",0,(fmt),__VA_ARGS__)
Debug macros which are off by default and fall back to ((void)0)
or somesuch.