Skip to content

Commit a444cd3

Browse files
committed
Define constants per-platform
1 parent f663627 commit a444cd3

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Python/perf_jit_trampoline.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,17 @@
109109

110110
/* These constants are defined inside <elf.h>, which we can't use outside of linux. */
111111
#if !defined(__linux__)
112-
# define EM_386 3
113-
# define EM_X86_64 62
114-
# define EM_ARM 40
115-
# define EM_AARCH64 183
116-
# define EM_RISCV 243
112+
# if defined(__i386__) || defined(_M_IX86)
113+
# define EM_386 3
114+
# elif defined(__arm__) || defined(_M_ARM)
115+
# define EM_ARM 40
116+
# elif defined(__x86_64__) || defined(_M_X64)
117+
# define EM_X86_64 62
118+
# elif defined(__aarch64__)
119+
# define EM_AARCH64 183
120+
# elif defined(__riscv)
121+
# define EM_RISCV 243
122+
# endif
117123
#endif
118124

119125
/* Convenient access to the global trampoline API state */

0 commit comments

Comments
 (0)