From 378c18e5f024ac5a8aef4cb40d7c9aa9633d144c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:30:35 +0200 Subject: Adding upstream version 2.38.1. Signed-off-by: Daniel Baumann --- include/debugobj.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/debugobj.h (limited to 'include/debugobj.h') diff --git a/include/debugobj.h b/include/debugobj.h new file mode 100644 index 0000000..73b70b8 --- /dev/null +++ b/include/debugobj.h @@ -0,0 +1,22 @@ +#ifndef UTIL_LINUX_DEBUGOBJ_H +#define UTIL_LINUX_DEBUGOBJ_H + +/* + * Include *after* debug.h and after UL_DEBUG_CURRENT_MASK define. + */ + +static inline void __attribute__ ((__format__ (__printf__, 2, 3))) +ul_debugobj(const void *handler, const char *mesg, ...) +{ + va_list ap; + + if (handler && !(UL_DEBUG_CURRENT_MASK & __UL_DEBUG_FL_NOADDR)) + fprintf(stderr, "[%p]: ", handler); + + va_start(ap, mesg); + vfprintf(stderr, mesg, ap); + va_end(ap); + fputc('\n', stderr); +} + +#endif /* UTIL_LINUX_DEBUGOBJ_H */ -- cgit v1.2.3