util.h and its impl are now c++
[staging/windowmanager.git] / src / util.hpp
1 #ifndef WM_UTIL_H
2 #define WM_UTIL_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #ifdef __GNUC__
9 #define ATTR_FORMAT(stringindex, firsttocheck) __attribute__((format(printf, stringindex, firsttocheck)))
10 #else
11 #define ATTR_FORMAT(stringindex, firsttocheck)
12 #endif
13
14 void lognotice(char const *fmt, ...) ATTR_FORMAT(1,2);
15 void logerror(char const *fmt, ...) ATTR_FORMAT(1,2);
16 void fatal(char const *fmt, ...) ATTR_FORMAT(1,2);
17
18 #ifdef DEBUG_OUTPUT
19 void logdebug(char const *fmt, ...) ATTR_FORMAT(1,2);
20 #else
21 static inline void logdebug(char const * fmt, ...) ATTR_FORMAT(1,2);
22 static inline void logdebug(char const * fmt, ...) {}
23 #endif
24
25 #ifdef __cplusplus
26 }
27 #endif
28
29 #endif // !WM_UTIL_H