aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo.h
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2013-02-26 21:29:57 -0600
committerPeter Seebach <peter.seebach@windriver.com>2013-02-26 21:29:57 -0600
commitbe1131e2ee2178bcc50ba04916fea527059f6aa0 (patch)
treee60e7c309825a9532985d304f79e65804e27135b /pseudo.h
parente076225ccdd10dabe3d6097c0682d8c88bd58753 (diff)
downloadpseudo-be1131e2ee2178bcc50ba04916fea527059f6aa0.tar.gz
pseudo-be1131e2ee2178bcc50ba04916fea527059f6aa0.tar.bz2
pseudo-be1131e2ee2178bcc50ba04916fea527059f6aa0.zip
completely remove pseudo_debugcalls when -DNDEBUG
Diffstat (limited to 'pseudo.h')
-rw-r--r--pseudo.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/pseudo.h b/pseudo.h
index 9d3e43f..ca2baa9 100644
--- a/pseudo.h
+++ b/pseudo.h
@@ -1,7 +1,7 @@
/*
* pseudo.h, shared definitions and structures for pseudo
*
- * Copyright (c) 2008-2010 Wind River Systems, Inc.
+ * Copyright (c) 2008-2010, 2013 Wind River Systems, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the Lesser GNU General Public License version 2.1 as
@@ -39,8 +39,11 @@ extern int pseudo_disabled;
extern int pseudo_debug_real(int, char *, ...) __attribute__ ((format (printf, 2, 3)));
#define pseudo_debug pseudo_debug_real
#else
-/* oh no, mister compiler, please don't optimize me away! */
-static inline void pseudo_debug(int level, char *text, ...) { }
+/* this used to be a static inline function, but that meant that arguments
+ * were still evaluated for side effects. We don't want that. The ...
+ * is a C99ism, also supported by GNU C.
+ */
+#define pseudo_debug(...) 0
#endif
extern int pseudo_diag(char *, ...) __attribute__ ((format (printf, 1, 2)));
void pseudo_new_pid(void);