mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Re-export Ones()
It's used by the nvidia driver
Fixes: 1642adec3 ("dix: unexport Ones()")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2051>
This commit is contained in:
@@ -205,7 +205,7 @@ extern Bool NoListenAll;
|
||||
extern Bool AllowByteSwappedClients;
|
||||
|
||||
#if __has_builtin(__builtin_popcountl)
|
||||
# define Ones __builtin_popcountl
|
||||
# define Xpopcountl __builtin_popcountl
|
||||
#else
|
||||
/*
|
||||
* Count the number of bits set to 1 in a 32-bit word.
|
||||
@@ -213,7 +213,7 @@ extern Bool AllowByteSwappedClients;
|
||||
* https://dspace.mit.edu/handle/1721.1/6086
|
||||
*/
|
||||
static inline int
|
||||
Ones(unsigned long mask)
|
||||
Xpopcountl(unsigned long mask)
|
||||
{
|
||||
unsigned long y;
|
||||
|
||||
@@ -222,5 +222,6 @@ Ones(unsigned long mask)
|
||||
return (((y + (y >> 3)) & 030707070707) % 077);
|
||||
}
|
||||
#endif
|
||||
#define Ones Xpopcountl
|
||||
|
||||
#endif /* _OSDEP_H_ */
|
||||
|
||||
10
os/utils.c
10
os/utils.c
@@ -1563,3 +1563,13 @@ AbortServer(void)
|
||||
OsAbort();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Exported version for binary compatibility with modules which call it */
|
||||
#undef Ones
|
||||
_X_EXPORT int Ones(unsigned long);
|
||||
|
||||
int
|
||||
Ones (unsigned long mask)
|
||||
{
|
||||
return Xpopcountl(mask);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user