MXS-2013 Minor cleanup of maxscale/debug.h

Removal of unnecessary include files had ripple effects.
This commit is contained in:
Johan Wikman
2018-08-14 16:13:05 +03:00
parent f975035e53
commit 228dcbe0ce
4 changed files with 28 additions and 24 deletions

View File

@ -13,17 +13,15 @@
*/ */
#include <maxscale/cdefs.h> #include <maxscale/cdefs.h>
#include <limits.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h>
#include <maxscale/log_manager.h> #include <maxscale/log_manager.h>
MXS_BEGIN_DECLS MXS_BEGIN_DECLS
#if defined(SS_DEBUG) #if defined(SS_DEBUG)
#include <maxscale/log_manager.h>
#define ss_dassert(exp) do { if(!(exp)){\ #define ss_dassert(exp) do { if(!(exp)){\
const char *debug_expr = #exp; /** The MXS_ERROR marco doesn't seem to like stringification */ \ const char *debug_expr = #exp; /** The MXS_ERROR marco doesn't seem to like stringification */ \
MXS_ERROR("debug assert at %s:%d failed: %s\n", (char*)__FILE__, __LINE__, debug_expr); \ MXS_ERROR("debug assert at %s:%d failed: %s\n", (char*)__FILE__, __LINE__, debug_expr); \
@ -34,18 +32,21 @@ MXS_BEGIN_DECLS
MXS_ERROR("debug assert at %s:%d failed: %s (%s)\n", (char*)__FILE__, __LINE__, info, debug_expr); \ MXS_ERROR("debug assert at %s:%d failed: %s (%s)\n", (char*)__FILE__, __LINE__, info, debug_expr); \
fprintf(stderr, "debug assert at %s:%d failed: %s (%s)\n", (char*)__FILE__, __LINE__, info, debug_expr); \ fprintf(stderr, "debug assert at %s:%d failed: %s (%s)\n", (char*)__FILE__, __LINE__, info, debug_expr); \
raise(SIGABRT);} } while (false) raise(SIGABRT);} } while (false)
#define ss_debug(exp) exp #define ss_debug(exp) exp
#define ss_dfprintf fprintf #define ss_dfprintf fprintf
#define ss_dfflush fflush #define ss_dfflush fflush
#define ss_dfwrite fwrite #define ss_dfwrite fwrite
#else /* SS_DEBUG */ #else /* SS_DEBUG */
#define ss_dassert(exp)
#define ss_info_dassert(exp, info)
#define ss_debug(exp) #define ss_debug(exp)
#define ss_dfprintf(a, b, ...) #define ss_dfprintf(a, b, ...)
#define ss_dfflush(s) #define ss_dfflush(s)
#define ss_dfwrite(a, b, c, d) #define ss_dfwrite(a, b, c, d)
# define ss_dassert(exp)
# define ss_info_dassert(exp, info)
#endif /* SS_DEBUG */ #endif /* SS_DEBUG */

View File

@ -13,8 +13,9 @@
*/ */
#include <maxscale/ccdefs.hh> #include <maxscale/ccdefs.hh>
#include <errno.h> #include <cerrno>
#include <maxbase/semaphore.h> #include <climits>
#include <maxscale/semaphore.h>
#include <maxscale/debug.h> #include <maxscale/debug.h>
namespace maxscale namespace maxscale

View File

@ -18,6 +18,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
#include <maxscale/alloc.h> #include <maxscale/alloc.h>
#include <maxscale/log_manager.h> #include <maxscale/log_manager.h>
#include <maxscale/debug.h> #include <maxscale/debug.h>

View File

@ -15,6 +15,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
#include <maxscale/alloc.h> #include <maxscale/alloc.h>
#include <maxscale/debug.h> #include <maxscale/debug.h>
#include <maxscale/log_manager.h> #include <maxscale/log_manager.h>