summaryrefslogtreecommitdiff
path: root/utils/log.h
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2004-11-07 19:19:11 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2004-11-07 19:19:11 +0000
commit5e41fb8a121c441a8765a1962a892e93906cde83 (patch)
tree0fd0a6aa6adbd7275b7a2fd9216d1e063a968ad0 /utils/log.h
downloadnstheme-5e41fb8a121c441a8765a1962a892e93906cde83.tar.gz
nstheme-5e41fb8a121c441a8765a1962a892e93906cde83.tar.bz2
[project @ 2004-11-07 19:19:11 by rjw]
Initial import. svn path=/import/nstheme/; revision=2436
Diffstat (limited to 'utils/log.h')
-rw-r--r--utils/log.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/log.h b/utils/log.h
new file mode 100644
index 0000000..65417b9
--- /dev/null
+++ b/utils/log.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of NetSurf, http://netsurf.sourceforge.net/
+ * Licensed under the GNU General Public License,
+ * http://www.opensource.org/licenses/gpl-license
+ * Copyright 2003 James Bursa <bursa@users.sourceforge.net>
+ * Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
+ */
+
+#include <stdio.h>
+
+#ifndef _NETSURF_LOG_H_
+#define _NETSURF_LOG_H_
+
+#ifdef NDEBUG
+# define LOG(x) ((void) 0)
+#else
+# ifdef __GNUC__
+# define LOG(x) (printf(__FILE__ " %s %i: ", __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout))
+# elif defined(__CC_NORCROFT)
+# define LOG(x) (printf(__FILE__ " %s %i: ", __func__, __LINE__), printf x, fputc('\n', stdout))
+# else
+# define LOG(x) (printf(__FILE__ " %i: ", __LINE__), printf x, fputc('\n', stdout))
+# endif
+#endif
+
+#endif