diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-12-13 11:20:20 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-12-13 11:20:20 +0100 |
commit | c0a0deec86c79d276bc4443fd0f6aef7b6b12f9f (patch) | |
tree | 0deed1f0a7ee103e21fdf1bb1418674e41405a50 /debug.c | |
parent | 47cf951c0440b5f37df563ffc25d44bce54926a3 (diff) |
Add clean target. Fix broken c++ compilation, add c++ compilation test to Makefile
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 32 |
1 files changed, 22 insertions, 10 deletions
@@ -51,18 +51,35 @@ struct dbg_config_t { unsigned int flags; -#ifdef WITH_DBG_MUTEX - pthread_mutex_t mutex; -#endif int fd; int file_fd; int stdout_no_date; +#ifdef WITH_DBG_MUTEX + pthread_mutex_t mutex; +#endif #ifdef WITH_DBG_SYSLOG const char* syslog_host; int syslog_port; #endif -};// dbg_config;// = { .flags = DBG_FLAG_DEFAULT, .fd = -1, .file_fd = -1 }; -static struct dbg_config_t dbg_config; +} dbg_config = { + DBG_FLAG_DEFAULT, // flags + -1, // fd + -1, // file_fd + 0, //stdout_no_date +#ifdef WITH_DBG_MUTEX + {}, // mutex; +#endif +#ifdef WITH_DBG_SYSLOG + "", // syslog_host; + -1, // syslog_port; +#endif + /* // This doesn't work in C++ + .flags = DBG_FLAG_DEFAULT, + .fd = -1, + .file_fd = -1, + .stdout_no_date = 0 + */ +}; static void dbg_mutex_init() { @@ -109,10 +126,6 @@ dbg_status_t dbg_init(unsigned int flags, ...) dbg_config.flags = flags; - dbg_config.fd = -1; - dbg_config.file_fd = -1; - dbg_config.stdout_no_date = 0; - int end = 0; va_list vl; @@ -289,4 +302,3 @@ done: return result; } - |