Skip to content

Commit 3f9e24d

Browse files
committed
Define constants per-platform
1 parent 50e80bf commit 3f9e24d

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
@@ -108,11 +108,17 @@
108108

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

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

0 commit comments

Comments
 (0)