Revert "include: move BUG_*() macros to separate header"

This breaks the xf86-input-synaptics driver:

  synaptics.c: In function 'clickpad_guess_clickfingers':
  synaptics.c:2638:5: error: implicit declaration of function 'BUG_RETURN_VAL' [-Werror=implicit-function-declaration]
   2638 |     BUG_RETURN_VAL(hw->num_mt_mask > sizeof(close_point) * 8, 0);

This reverts commit 442aec2219.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1316>
This commit is contained in:
Peter Hutterer 2024-02-20 11:12:38 +10:00 committed by Marge Bot
parent af9f70013a
commit eaa92ea422
22 changed files with 27 additions and 60 deletions

View File

@ -60,7 +60,6 @@ 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"

View File

@ -89,8 +89,6 @@ 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"

View File

@ -45,7 +45,6 @@
#include <dix-config.h>
#endif
#include "bug.h"
#include "xibarriers.h"
#include "scrnintstr.h"
#include "cursorstr.h"

View File

@ -50,8 +50,6 @@ SOFTWARE.
#include <X11/X.h>
#include <X11/Xmd.h>
#include "bug.h"
#include "servermd.h"
#include "scrnintstr.h"
#include "dixstruct.h"

View File

@ -53,7 +53,6 @@ SOFTWARE.
#include "resource.h"
#include <X11/Xproto.h>
#include <X11/Xatom.h>
#include "bug.h"
#include "windowstr.h"
#include "inputstr.h"
#include "scrnintstr.h"

View File

@ -32,8 +32,6 @@
#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"

View File

@ -106,8 +106,6 @@ Equipment Corporation.
#endif
#include <X11/X.h>
#include "bug.h"
#include "misc.h"
#include "resource.h"
#include <X11/Xproto.h>

View File

@ -38,7 +38,6 @@
#include "eventconvert.h"
#include "windowstr.h"
#include "mi.h"
#include "bug.h"
#define GESTURE_HISTORY_SIZE 100

View File

@ -37,7 +37,6 @@
#include <math.h>
#include <limits.h>
#include "bug.h"
#include "misc.h"
#include "resource.h"
#include "inputstr.h"

View File

@ -62,7 +62,6 @@ 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)

View File

@ -27,7 +27,6 @@
#include "dix-config.h"
#endif
#include "bug.h"
#include "exevents.h"
#include "exglobals.h"
#include "misc.h"

View File

@ -31,7 +31,6 @@
#include <exevents.h>
#include <X11/Xatom.h>
#include <os.h>
#include "bug.h"
#include <xserver-properties.h>

View File

@ -39,7 +39,6 @@
#include "eventconvert.h"
#include "windowstr.h"
#include "mi.h"
#include "bug.h"
#define TOUCH_HISTORY_SIZE 100

View File

@ -29,7 +29,6 @@
#include <linux/input.h>
#include <sys/mman.h>
#include "bug.h"
#include <inputstr.h>
#include <exevents.h>
#include <xkbsrv.h>

View File

@ -1,33 +0,0 @@
#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 */

View File

@ -416,4 +416,31 @@ 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 */

View File

@ -39,8 +39,6 @@ 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"

View File

@ -32,8 +32,6 @@
* Basic transpose step
*/
#include "bug.h"
static inline void _transp(CARD32 d[], unsigned int i1, unsigned int i2,
unsigned int shift, CARD32 mask)
{

View File

@ -72,8 +72,6 @@ SOFTWARE.
#endif
#include <X11/X.h>
#include <X11/Xproto.h>
#include "bug.h"
#include "os.h"
#include "osdep.h"
#include "opaque.h"

View File

@ -89,7 +89,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include "input.h"
#include "opaque.h"
#include "bug.h"
#ifdef WIN32
#include <process.h>

View File

@ -82,7 +82,6 @@ __stdcall unsigned long GetTickCount(void);
#include "dixfont.h"
#include <X11/fonts/libxfont2.h>
#include "osdep.h"
#include "bug.h"
#include "xdmcp.h"
#include "extension.h"
#include <signal.h>

View File

@ -48,7 +48,6 @@ 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)