], [
AC_DEFINE(ENABLE_DEBUG, [0], [Debug messages.])
])
+AC_DEFINE(ENABLE_ELFDBG, [0], [Debug elf parsing messages.])
AC_ARG_ENABLE([coverage],
AS_HELP_STRING([--enable-coverage], [enable test coverage @<:@default=disabled@:>@]),
} header;
};
+//#undef ENABLE_ELFDBG
//#define ENABLE_ELFDBG 1
-#if (ENABLE_LOGGING == 1) && defined(ENABLE_ELFDBG)
-#define ELFDBG(elf, ...) _elf_dbg(elf, __FILE__, __LINE__, __func__, __VA_ARGS__);
+#define ELFDBG(elf, ...) \
+ do { \
+ if (ENABLE_LOGGING == 1 && ENABLE_ELFDBG == 1) \
+ _elf_dbg(elf, __FILE__, __LINE__, __func__, __VA_ARGS__); \
+ } while (0);
static inline void _elf_dbg(const struct kmod_elf *elf, const char *fname, unsigned line,
const char *func, const char *fmt, ...)
vfprintf(stderr, fmt, args);
va_end(args);
}
-#else
-#define ELFDBG(elf, ...)
-#endif
static int elf_identify(const void *memory, uint64_t size)
{
cdata.set10('ENABLE_LOGGING', get_option('logging'))
cdata.set10('ENABLE_DEBUG', get_option('debug-messages'))
+cdata.set10('ENABLE_ELFDBG', false)
pkg = import('pkgconfig')
cc = meson.get_compiler('c')