include: move BUG_*() macros to separate header
Yet another step of uncluttering includes: move out the BUG_* macros into a separate header, which then is included as-needed. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
a8bb924af1
commit
442aec2219
|
@ -60,6 +60,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xmd.h>
|
||||
#include "scrnintstr.h"
|
||||
#include "os.h"
|
||||
#include "bug.h"
|
||||
#include "extnsionst.h"
|
||||
#include "dixstruct.h"
|
||||
#include "pixmapstr.h"
|
||||
|
|
|
@ -89,6 +89,8 @@ SOFTWARE.
|
|||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include "windowstr.h"
|
||||
#include "miscstruct.h"
|
||||
#include "region.h"
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "bug.h"
|
||||
#include "xibarriers.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "cursorstr.h"
|
||||
|
|
|
@ -50,6 +50,8 @@ SOFTWARE.
|
|||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include "servermd.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "dixstruct.h"
|
||||
|
|
|
@ -53,6 +53,7 @@ SOFTWARE.
|
|||
#include "resource.h"
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include "bug.h"
|
||||
#include "windowstr.h"
|
||||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include <X11/extensions/XI2.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include "inputstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "scrnintstr.h"
|
||||
|
|
|
@ -106,6 +106,8 @@ Equipment Corporation.
|
|||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include "misc.h"
|
||||
#include "resource.h"
|
||||
#include <X11/Xproto.h>
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "eventconvert.h"
|
||||
#include "windowstr.h"
|
||||
#include "mi.h"
|
||||
#include "bug.h"
|
||||
|
||||
#define GESTURE_HISTORY_SIZE 100
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <math.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include "misc.h"
|
||||
#include "resource.h"
|
||||
#include "inputstr.h"
|
||||
|
|
|
@ -62,6 +62,7 @@ SOFTWARE.
|
|||
#include "exglobals.h"
|
||||
#include "inpututils.h"
|
||||
#include "client.h"
|
||||
#include "bug.h"
|
||||
|
||||
#define BITMASK(i) (((Mask)1) << ((i) & 31))
|
||||
#define MASKIDX(i) ((i) >> 5)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "dix-config.h"
|
||||
#endif
|
||||
|
||||
#include "bug.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
#include "misc.h"
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <exevents.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <os.h>
|
||||
#include "bug.h"
|
||||
|
||||
#include <xserver-properties.h>
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "eventconvert.h"
|
||||
#include "windowstr.h"
|
||||
#include "mi.h"
|
||||
#include "bug.h"
|
||||
|
||||
#define TOUCH_HISTORY_SIZE 100
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/input.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include <inputstr.h>
|
||||
#include <exevents.h>
|
||||
#include <xkbsrv.h>
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef _XSERVER_OS_BUG_H
|
||||
#define _XSERVER_OS_BUG_H
|
||||
|
||||
#include "os.h"
|
||||
|
||||
/* Don't use this directly, use BUG_WARN or BUG_WARN_MSG instead */
|
||||
#define __BUG_WARN_MSG(cond, with_msg, ...) \
|
||||
do { if (cond) { \
|
||||
ErrorFSigSafe("BUG: triggered 'if (" #cond ")'\n"); \
|
||||
ErrorFSigSafe("BUG: %s:%u in %s()\n", \
|
||||
__FILE__, __LINE__, __func__); \
|
||||
if (with_msg) ErrorFSigSafe(__VA_ARGS__); \
|
||||
xorg_backtrace(); \
|
||||
} } while(0)
|
||||
|
||||
#define BUG_WARN_MSG(cond, ...) \
|
||||
__BUG_WARN_MSG(cond, 1, __VA_ARGS__)
|
||||
|
||||
#define BUG_WARN(cond) __BUG_WARN_MSG(cond, 0, NULL)
|
||||
|
||||
#define BUG_RETURN(cond) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return; } } while(0)
|
||||
|
||||
#define BUG_RETURN_MSG(cond, ...) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return; } } while(0)
|
||||
|
||||
#define BUG_RETURN_VAL(cond, val) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return (val); } } while(0)
|
||||
|
||||
#define BUG_RETURN_VAL_MSG(cond, val, ...) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return (val); } } while(0)
|
||||
|
||||
#endif /* _XSERVER_OS_BUG_H */
|
|
@ -416,31 +416,4 @@ typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
|
|||
extern _X_EXPORT unsigned long globalSerialNumber;
|
||||
extern _X_EXPORT unsigned long serverGeneration;
|
||||
|
||||
/* Don't use this directly, use BUG_WARN or BUG_WARN_MSG instead */
|
||||
#define __BUG_WARN_MSG(cond, with_msg, ...) \
|
||||
do { if (cond) { \
|
||||
ErrorFSigSafe("BUG: triggered 'if (" #cond ")'\n"); \
|
||||
ErrorFSigSafe("BUG: %s:%u in %s()\n", \
|
||||
__FILE__, __LINE__, __func__); \
|
||||
if (with_msg) ErrorFSigSafe(__VA_ARGS__); \
|
||||
xorg_backtrace(); \
|
||||
} } while(0)
|
||||
|
||||
#define BUG_WARN_MSG(cond, ...) \
|
||||
__BUG_WARN_MSG(cond, 1, __VA_ARGS__)
|
||||
|
||||
#define BUG_WARN(cond) __BUG_WARN_MSG(cond, 0, NULL)
|
||||
|
||||
#define BUG_RETURN(cond) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return; } } while(0)
|
||||
|
||||
#define BUG_RETURN_MSG(cond, ...) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return; } } while(0)
|
||||
|
||||
#define BUG_RETURN_VAL(cond, val) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return (val); } } while(0)
|
||||
|
||||
#define BUG_RETURN_VAL_MSG(cond, val, ...) \
|
||||
do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return (val); } } while(0)
|
||||
|
||||
#endif /* MISC_H */
|
||||
|
|
|
@ -39,6 +39,8 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include <X11/X.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include "misc.h"
|
||||
#include "windowstr.h"
|
||||
#include "pixmapstr.h"
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
* Basic transpose step
|
||||
*/
|
||||
|
||||
#include "bug.h"
|
||||
|
||||
static inline void _transp(CARD32 d[], unsigned int i1, unsigned int i2,
|
||||
unsigned int shift, CARD32 mask)
|
||||
{
|
||||
|
|
2
os/io.c
2
os/io.c
|
@ -72,6 +72,8 @@ SOFTWARE.
|
|||
#endif
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "bug.h"
|
||||
#include "os.h"
|
||||
#include "osdep.h"
|
||||
#include "opaque.h"
|
||||
|
|
1
os/log.c
1
os/log.c
|
@ -89,6 +89,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#include "input.h"
|
||||
#include "opaque.h"
|
||||
#include "bug.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <process.h>
|
||||
|
|
|
@ -82,6 +82,7 @@ __stdcall unsigned long GetTickCount(void);
|
|||
#include "dixfont.h"
|
||||
#include <X11/fonts/libxfont2.h>
|
||||
#include "osdep.h"
|
||||
#include "bug.h"
|
||||
#include "extension.h"
|
||||
#include <signal.h>
|
||||
#ifndef WIN32
|
||||
|
|
|
@ -49,6 +49,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "xkbgeom.h"
|
||||
#include <X11/extensions/XKMformat.h>
|
||||
#include "xkbfile.h"
|
||||
#include "bug.h"
|
||||
|
||||
#define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue