Skip to content
Snippets Groups Projects
Commit be8e5744 authored by Damien George's avatar Damien George
Browse files

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.
parent 613510bc
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,11 @@ ...@@ -34,7 +34,11 @@
// x86-64 callee-save registers are: // x86-64 callee-save registers are:
// rbx, rbp, rsp, r12, r13, r14, r15 // 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); __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr);
......
...@@ -35,7 +35,11 @@ ...@@ -35,7 +35,11 @@
// For reference, x86 callee save regs are: // For reference, x86 callee save regs are:
// ebx, esi, edi, ebp, esp, eip // 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 #if NLR_OS_WINDOWS
unsigned int nlr_push_tail(nlr_buf_t *nlr) asm("nlr_push_tail"); unsigned int nlr_push_tail(nlr_buf_t *nlr) asm("nlr_push_tail");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment