Skip to content

Commit

Permalink
Merge pull request #238 from jeremyd2019/patch-1
Browse files Browse the repository at this point in the history
prefix symbols with _ for 32-bit x86 Windows
  • Loading branch information
ViralBShah authored Sep 8, 2021
2 parents 71a8fd1 + 6ae6318 commit 3b9454f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/cdefs-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,21 @@
#endif /* __warn_references */
#endif /* __STDC__ */
#elif defined(__clang__) /* CLANG */
#if defined(_WIN32) && defined (_X86_)
#define openlibm_symbol_prefix "_"
#else
#define openlibm_symbol_prefix ""
#endif
#ifdef __STDC__
#define openlibm_weak_reference(sym,alias) \
__asm__(".weak_reference " #alias); \
__asm__(".set " #alias ", " #sym)
__asm__(".weak_reference " openlibm_symbol_prefix #alias); \
__asm__(".set " openlibm_symbol_prefix #alias ", " openlibm_symbol_prefix #sym)
#else
#define openlibm_weak_reference(sym,alias) \
__asm__(".weak_reference alias");\
__asm__(".set alias, sym")
__asm__(".weak_reference openlibm_symbol_prefix/**/alias");\
__asm__(".set openlibm_symbol_prefix/**/alias, openlibm_symbol_prefix/**/sym")
#endif
#undef openlibm_symbol_prefix
#else /* !__ELF__ */
#ifdef __STDC__
#define openlibm_weak_reference(sym,alias) \
Expand Down

0 comments on commit 3b9454f

Please sign in to comment.