summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae210a9)
raw | patch | inline | side by side (parent: ae210a9)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 6 Jun 2008 10:21:01 +0000 (12:21 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 6 Jun 2008 10:21:01 +0000 (12:21 +0200) |
All __attribute__'s will be automatically set to /**/ when not using the
GNU CC via a macro in src/collectd.h. This way this should be portable.
GNU CC via a macro in src/collectd.h. This way this should be portable.
src/collectd.h | patch | blob | history | |
src/plugin.h | patch | blob | history |
diff --git a/src/collectd.h b/src/collectd.h
index 55aac160587a889e488554ac1009660047d3382b..411048af0694650fb61c5c588926c35cb4dad20d 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
#define STATIC_ARRAY_LEN(array) (sizeof (array) / sizeof ((array)[0]))
+/* Remove GNU specific __attribute__ settings when using another compiler */
+#if !__GNUC__
+# define __attribute__(x) /**/
+#endif
+
extern char hostname_g[];
extern int interval_g;
diff --git a/src/plugin.h b/src/plugin.h
index 25c745cbbccede74eb1398da38653d129566b248..91978bd93a7695256553c927d60f414b584d06d2 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
int plugin_dispatch_notification (const notification_t *notif);
-void plugin_log (int level, const char *format, ...);
+void plugin_log (int level, const char *format, ...)
+ __attribute__ ((format(printf,2,3)));
+
#define ERROR(...) plugin_log (LOG_ERR, __VA_ARGS__)
#define WARNING(...) plugin_log (LOG_WARNING, __VA_ARGS__)
#define NOTICE(...) plugin_log (LOG_NOTICE, __VA_ARGS__)