summaryrefslogtreecommitdiffstats
path: root/Utilities/cmxmlrpc/casprintf.h
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmxmlrpc/casprintf.h')
-rw-r--r--Utilities/cmxmlrpc/casprintf.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Utilities/cmxmlrpc/casprintf.h b/Utilities/cmxmlrpc/casprintf.h
new file mode 100644
index 0000000..eab336a
--- /dev/null
+++ b/Utilities/cmxmlrpc/casprintf.h
@@ -0,0 +1,19 @@
+#ifndef CASPRINTF_H_INCLUDED
+
+/* GNU_PRINTF_ATTR lets the GNU compiler check pm_message() and pm_error()
+ calls to be sure the arguments match the format string, thus preventing
+ runtime segmentation faults and incorrect messages.
+*/
+#ifdef __GNUC__
+#define GNU_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
+#else
+#define GNU_PRINTF_ATTR(a,b)
+#endif
+
+void GNU_PRINTF_ATTR(2,3)
+casprintf(const char ** const retvalP, const char * const fmt, ...);
+
+void
+strfree(const char * const string);
+
+#endif