diff options
author | Damien George <damien.p.george@gmail.com> | 2017-08-29 12:52:18 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-08-29 12:52:18 +1000 |
commit | be8e5744e64aec10a3499fd6ea034bbf4be0c871 (patch) | |
tree | 4cdd2a8529b73c9eb4be0952fcce18b79600b8de /py | |
parent | 613510bce83b8318bd21bcd17f247ba30e0d7cea (diff) |
py/nlrx86,x64: Replace #define of defined() with portable macro usage.
Using gcc -Wpedantic will warn that #define of defined() is non-portable
and this patch fixes this.
Diffstat (limited to 'py')
-rw-r--r-- | py/nlrx64.c | 6 | ||||
-rw-r--r-- | py/nlrx86.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/py/nlrx64.c b/py/nlrx64.c index c23fd8fc6..aeaacd50c 100644 --- a/py/nlrx64.c +++ b/py/nlrx64.c @@ -34,7 +34,11 @@ // x86-64 callee-save registers are: // rbx, rbp, rsp, r12, r13, r14, r15 -#define NLR_OS_WINDOWS (defined(_WIN32) || defined(__CYGWIN__)) +#if defined(_WIN32) || defined(__CYGWIN__) +#define NLR_OS_WINDOWS 1 +#else +#define NLR_OS_WINDOWS 0 +#endif __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr); diff --git a/py/nlrx86.c b/py/nlrx86.c index 58aaa1a57..8d15d7bab 100644 --- a/py/nlrx86.c +++ b/py/nlrx86.c @@ -35,7 +35,11 @@ // For reference, x86 callee save regs are: // ebx, esi, edi, ebp, esp, eip -#define NLR_OS_WINDOWS (defined(_WIN32) || defined(__CYGWIN__)) +#if defined(_WIN32) || defined(__CYGWIN__) +#define NLR_OS_WINDOWS 1 +#else +#define NLR_OS_WINDOWS 0 +#endif #if NLR_OS_WINDOWS unsigned int nlr_push_tail(nlr_buf_t *nlr) asm("nlr_push_tail"); |