Skip to content

Commit 4e2ab23

Browse files
committed
[PR #1432] include: misc.h: unexport lowbit() macro
PR: #1432
1 parent 020e468 commit 4e2ab23

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

dix/window.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Equipment Corporation.
117117
#include "mi/mi_priv.h" /* miPaintWindow */
118118
#include "os/auth.h"
119119
#include "os/client_priv.h"
120+
#include "os/osdep.h"
120121
#include "os/screensaver.h"
121122
#include "Xext/panoramiX.h"
122123
#include "Xext/panoramiXsrv.h"

hw/xnest/Color.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ is" without express or implied warranty.
2020
#include <xcb/xcb.h>
2121

2222
#include "dix/colormap_priv.h"
23+
#include "os/osdep.h"
2324

2425
#include "scrnintstr.h"
2526
#include "window.h"

include/misc.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,6 @@ typedef struct _xReq *xReqPtr;
136136
#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
137137
/* this assumes b > 0 */
138138
#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
139-
/*
140-
* return the least significant bit in x which is set
141-
*
142-
* This works on 1's complement and 2's complement machines.
143-
* If you care about the extra instruction on 2's complement
144-
* machines, change to ((x) & (-(x)))
145-
*/
146-
#define lowbit(x) ((x) & (~(x) + 1))
147139

148140
/* XXX Not for modules */
149141
#include <limits.h>

os/osdep.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ SOFTWARE.
5757
#include <X11/Xmd.h>
5858
#include <X11/Xdefs.h>
5959

60+
/*
61+
* return the least significant bit in x which is set
62+
*
63+
* This works on 1's complement and 2's complement machines.
64+
* If you care about the extra instruction on 2's complement
65+
* machines, change to ((x) & (-(x)))
66+
*/
67+
#define lowbit(x) ((x) & (~(x) + 1)) // unexport
68+
6069
#ifndef __has_builtin
6170
# define __has_builtin(x) 0 /* Compatibility with older compilers */
6271
#endif

0 commit comments

Comments
 (0)