This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository legacy-imlib2.
View the commit online.
commit 11cef49cef19c4683b3df011de3eddba25d83db8
Author: Kim Woelders <[email protected]>
AuthorDate: Mon May 8 12:10:13 2023 +0200
Introduce __imlib_perror() to produce error messages
---
src/lib/Imlib2_Loader.h | 3 +++
src/lib/debug.c | 19 +++++++++++++++++++
src/lib/debug.h | 2 ++
3 files changed, 24 insertions(+)
diff --git a/src/lib/Imlib2_Loader.h b/src/lib/Imlib2_Loader.h
index 910b3c6..e8d45bb 100644
--- a/src/lib/Imlib2_Loader.h
+++ b/src/lib/Imlib2_Loader.h
@@ -107,6 +107,9 @@ unsigned int __imlib_time_us(void);
#endif /* IMLIB2_DEBUG */
+#define E(fmt...) __imlib_perror(DBG_PFX, fmt)
+__PRINTF_2__ void __imlib_perror(const char *pfx, const char *fmt, ...);
+
/* image.h */
/* 32767 is the maximum pixmap dimension and ensures that
diff --git a/src/lib/debug.c b/src/lib/debug.c
index bbbe0db..c5890fe 100644
--- a/src/lib/debug.c
+++ b/src/lib/debug.c
@@ -69,7 +69,26 @@ __imlib_printf(const char *pfx, const char *fmt, ...)
fmt = fmtx;
}
vfprintf(opt_fout, fmt, args);
+
va_end(args);
}
#endif /* IMLIB2_DEBUG */
+
+__EXPORT__ void
+__imlib_perror(const char *pfx, const char *fmt, ...)
+{
+ char fmtx[1024];
+ va_list args;
+
+ va_start(args, fmt);
+
+ if (pfx)
+ {
+ snprintf(fmtx, sizeof(fmtx), "ERROR: %-4s: %s", pfx, fmt);
+ fmt = fmtx;
+ }
+ vfprintf(stderr, fmt, args);
+
+ va_end(args);
+}
diff --git a/src/lib/debug.h b/src/lib/debug.h
index 128fe61..50a56c2 100644
--- a/src/lib/debug.h
+++ b/src/lib/debug.h
@@ -33,4 +33,6 @@ unsigned int __imlib_time_us(void);
#endif /* IMLIB2_DEBUG */
+__PRINTF_2__ void __imlib_perror(const char *pfx, const char *fmt, ...);
+
#endif /* IMLIB2_DEDUG_H */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.