mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
engine: platform: linux: define portability macro for sigevent (oh, glibc...)
This commit is contained in:
parent
296f89acf9
commit
7d464df107
@ -29,7 +29,8 @@ GNU General Public License for more details.
|
|||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 30)
|
#if defined( __GLIBC__ )
|
||||||
|
#if ( __GLIBC__ <= 2 ) && ( __GLIBC_MINOR__ <= 30 )
|
||||||
// Library support was added in glibc 2.30.
|
// Library support was added in glibc 2.30.
|
||||||
// Earlier glibc versions did not provide a wrapper for this system call,
|
// Earlier glibc versions did not provide a wrapper for this system call,
|
||||||
// necessitating the use of syscall(2).
|
// necessitating the use of syscall(2).
|
||||||
@ -39,7 +40,14 @@ static pid_t gettid( void )
|
|||||||
{
|
{
|
||||||
return syscall( SYS_gettid );
|
return syscall( SYS_gettid );
|
||||||
}
|
}
|
||||||
#endif
|
#endif // ( __GLIBC__ <= 2 ) && ( __GLIBC_MINOR__ <= 30 )
|
||||||
|
|
||||||
|
// Glibc misses this macro in POSIX headers (bits/types/sigevent_t.h)
|
||||||
|
// but it does present in Linux headers (asm-generic/siginfo.h) and musl
|
||||||
|
#if !defined( sigev_notify_thread_id )
|
||||||
|
#define sigev_notify_thread_id _sigev_un._tid
|
||||||
|
#endif // !defined( sigev_notify_thread_id )
|
||||||
|
#endif // defined(__GLIBC__)
|
||||||
|
|
||||||
static void *g_hsystemd;
|
static void *g_hsystemd;
|
||||||
static int (*g_pfn_sd_notify)( int unset_environment, const char *state );
|
static int (*g_pfn_sd_notify)( int unset_environment, const char *state );
|
||||||
|
Loading…
Reference in New Issue
Block a user