Skip to content

Commit 1f3925b

Browse files
committed
Merge pull request #56 from tkelman/ldexp
Export ldexp aliases on Windows
2 parents dbc3e22 + 8b59bbc commit 1f3925b

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

amd64/s_scalbn.S

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ ENTRY(scalbn)
4141
fstpl -8(%rsp)
4242
movsd -8(%rsp),%xmm0
4343
ret
44+
#ifndef _WIN64
4445
END(scalbn)
45-
4646
.globl CNAME(ldexp)
47+
#else
48+
.globl CNAME(ldexp); .section .drectve; .ascii " -export:ldexp"
49+
#endif
4750
.set CNAME(ldexp),CNAME(scalbn)
51+
4852
/* Enable stack protection */
4953
#if defined(__linux__) && defined(__ELF__)
5054
.section .note.GNU-stack,"",%progbits

amd64/s_scalbnf.S

+5-3
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ ENTRY(scalbnf)
4141
fstps -8(%rsp)
4242
movss -8(%rsp),%xmm0
4343
ret
44+
#ifndef _WIN64
4445
END(scalbnf)
45-
4646
.globl CNAME(ldexpf)
47-
.set CNAME(ldexpf),CNAME(scalbnf)
47+
#else
48+
.globl CNAME(ldexpf); .section .drectve; .ascii " -export:ldexpf"
49+
#endif
50+
.set CNAME(ldexpf),CNAME(scalbnf)
4851

49-
5052
/* Enable stack protection */
5153
#if defined(__linux__) && defined(__ELF__)
5254
.section .note.GNU-stack,"",%progbits

amd64/s_scalbnl.S

+6-4
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ ENTRY(scalbnl)
2626
fstpt (%rcx)
2727
#endif
2828
ret
29+
#ifndef _WIN64
2930
END(scalbnl)
31+
.globl CNAME(ldexpl)
32+
#else
33+
.globl CNAME(ldexpl); .section .drectve; .ascii " -export:ldexpl"
34+
#endif
35+
.set CNAME(ldexpl),CNAME(scalbnl)
3036

31-
.globl CNAME(ldexpl)
32-
.set CNAME(ldexpl),CNAME(scalbnl)
33-
34-
3537
/* Enable stack protection */
3638
#if defined(__linux__) && defined(__ELF__)
3739
.section .note.GNU-stack,"",%progbits

include/cdefs-compat.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222

2323
#ifdef __GNUC__
2424
#ifndef __strong_reference
25-
#define __strong_reference(sym,aliassym)
26-
//extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
25+
#ifdef __APPLE__
26+
#define __strong_reference(sym,aliassym) __weak_reference(sym,aliassym)
27+
#else
28+
#define __strong_reference(sym,aliassym) \
29+
DLLEXPORT extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
30+
#endif /* __APPLE__ */
2731
#endif /* __strong_reference */
2832

2933
#ifndef __weak_reference

0 commit comments

Comments
 (0)