mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-15 02:10:35 +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> (cherry picked from commit061690c2e6)
This commit is contained in:
parent
59673c0503
commit
f5e806f2d4
2 changed files with 13 additions and 2 deletions
|
|
@ -251,7 +251,7 @@ Bool WaitForSomething(Bool clients_are_ready);
|
|||
void CloseDownConnection(ClientPtr client);
|
||||
|
||||
#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.
|
||||
|
|
@ -259,7 +259,7 @@ void CloseDownConnection(ClientPtr client);
|
|||
* https://dspace.mit.edu/handle/1721.1/6086
|
||||
*/
|
||||
static inline int
|
||||
Ones(unsigned long mask)
|
||||
Xpopcountl(unsigned long mask)
|
||||
{
|
||||
unsigned long y;
|
||||
|
||||
|
|
@ -268,5 +268,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
|
|
@ -2020,3 +2020,13 @@ os_move_fd(int fd)
|
|||
return newfd;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 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