mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 16:20:03 +01: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:
parent
bf867b4658
commit
061690c2e6
2 changed files with 13 additions and 2 deletions
|
|
@ -205,7 +205,7 @@ extern Bool NoListenAll;
|
||||||
extern Bool AllowByteSwappedClients;
|
extern Bool AllowByteSwappedClients;
|
||||||
|
|
||||||
#if __has_builtin(__builtin_popcountl)
|
#if __has_builtin(__builtin_popcountl)
|
||||||
# define Ones __builtin_popcountl
|
# define Xpopcountl __builtin_popcountl
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* Count the number of bits set to 1 in a 32-bit word.
|
* 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
|
* https://dspace.mit.edu/handle/1721.1/6086
|
||||||
*/
|
*/
|
||||||
static inline int
|
static inline int
|
||||||
Ones(unsigned long mask)
|
Xpopcountl(unsigned long mask)
|
||||||
{
|
{
|
||||||
unsigned long y;
|
unsigned long y;
|
||||||
|
|
||||||
|
|
@ -222,5 +222,6 @@ Ones(unsigned long mask)
|
||||||
return (((y + (y >> 3)) & 030707070707) % 077);
|
return (((y + (y >> 3)) & 030707070707) % 077);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#define Ones Xpopcountl
|
||||||
|
|
||||||
#endif /* _OSDEP_H_ */
|
#endif /* _OSDEP_H_ */
|
||||||
|
|
|
||||||
10
os/utils.c
10
os/utils.c
|
|
@ -1563,3 +1563,13 @@ AbortServer(void)
|
||||||
OsAbort();
|
OsAbort();
|
||||||
exit(1);
|
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);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue