[icinga-checkins] icinga.org: icinga-core/test/ido: idoutils logging: Fix non gcc compiler problems with gnu extension __printf__ #1253

git at icinga.org git at icinga.org
Wed Feb 22 10:41:11 CET 2012


Module: icinga-core
Branch: test/ido
Commit: 543952f20195736c6722903ea2bc602501f8fecd
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=543952f20195736c6722903ea2bc602501f8fecd

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Fri Feb  3 20:42:33 2012 +0100

idoutils logging: Fix non gcc compiler problems with gnu extension __printf__ #1253
refs #1253

---

 include/logging.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/logging.h b/include/logging.h
index 192a837..dc2b166 100644
--- a/include/logging.h
+++ b/include/logging.h
@@ -89,10 +89,16 @@
 
 
 /**** Logging Functions ****/
+/* __printf__ etc. are gnu specific,not usable with cc */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
 void logit(int,int,const char *, ...)
 	__attribute__((__format__(__printf__, 3, 4)));
 int log_debug_info(int,int,const char *,...)
 	__attribute__((__format__(__printf__, 3, 4)));
+#else
+	void logit(int,int,const char *, ...);
+	int log_debug_info(int,int,const char *,...);
+#endif /* gnu */
 
 #ifndef NSCGI
 int write_to_all_logs(char *,unsigned long);            /* writes a string to main log file and syslog facility */





More information about the icinga-checkins mailing list