From: John Spencer Date: Sun, 2 Dec 2012 23:27:22 +0000 (+0100) Subject: Fix glibc version checks X-Git-Tag: v4.8~204 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb54c4772581a143e2757a2be9718377058cc703;p=strace Fix glibc version checks * util.c: Check if __GLIBC__ is defined before using it. * signal.c: Likewise. Fix __GLIBC_MINOR__ checks. --- diff --git a/signal.c b/signal.c index efe335c2..c77758f7 100644 --- a/signal.c +++ b/signal.c @@ -419,7 +419,7 @@ print_sigset(struct tcb *tcp, long addr, int rt) # define SI_FROMUSER(sip) ((sip)->si_code <= 0) #endif -#if __GLIBC_MINOR__ < 1 +#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) /* Type for data associated with a signal. */ typedef union sigval { @@ -1111,7 +1111,7 @@ sys_sigsuspend(struct tcb *tcp) #if !defined SS_ONSTACK #define SS_ONSTACK 1 #define SS_DISABLE 2 -#if __GLIBC_MINOR__ == 0 +#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) typedef struct { __ptr_t ss_sp; diff --git a/util.c b/util.c index a4393887..f42024d8 100644 --- a/util.c +++ b/util.c @@ -39,7 +39,7 @@ # include #endif -#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) +#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) # include #endif