forked from GabLeRoux/macos-crossover-wine-cloud-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
msvcrt-sincos.patch
180 lines (177 loc) · 4.83 KB
/
msvcrt-sincos.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
From f0131276474997b9d4e593bbf8c5616b879d3bd5 Mon Sep 17 00:00:00 2001
From: Jacek Caban <[email protected]>
Date: Tue, 18 May 2021 18:08:43 +0200
Subject: [PATCH] msvcrt: Add sincos to importlib.
Fixes cross compilation with GCC 11, which may optimize a pair of sin(),
cos() calls to a single sincos() call, which is not exported by any
msvcrt version.
Signed-off-by: Jacek Caban <[email protected]>
Signed-off-by: Piotr Caban <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
---
dlls/msvcr100/Makefile.in | 1 +
dlls/msvcr110/Makefile.in | 1 +
dlls/msvcr120/Makefile.in | 1 +
dlls/msvcr70/Makefile.in | 1 +
dlls/msvcr71/Makefile.in | 1 +
dlls/msvcr80/Makefile.in | 1 +
dlls/msvcr90/Makefile.in | 1 +
dlls/msvcrt/Makefile.in | 1 +
dlls/msvcrt/sincos.c | 40 +++++++++++++++++++++++++++++++++++++++
dlls/ucrtbase/Makefile.in | 1 +
10 files changed, 49 insertions(+)
create mode 100644 dlls/msvcrt/sincos.c
diff --git a/dlls/msvcr100/Makefile.in b/dlls/msvcr100/Makefile.in
index c5a7710ea419..edf4b4d4407a 100644
--- a/dlls/msvcr100/Makefile.in
+++ b/dlls/msvcr100/Makefile.in
@@ -34,6 +34,7 @@ C_SRCS = \
process.c \
scanf.c \
scheduler.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcr110/Makefile.in b/dlls/msvcr110/Makefile.in
index d2ba0ac29e3b..c3ee2ca7e8e1 100644
--- a/dlls/msvcr110/Makefile.in
+++ b/dlls/msvcr110/Makefile.in
@@ -34,6 +34,7 @@ C_SRCS = \
process.c \
scanf.c \
scheduler.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcr120/Makefile.in b/dlls/msvcr120/Makefile.in
index 68a85c581d1f..953e9760ca01 100644
--- a/dlls/msvcr120/Makefile.in
+++ b/dlls/msvcr120/Makefile.in
@@ -34,6 +34,7 @@ C_SRCS = \
process.c \
scanf.c \
scheduler.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcr70/Makefile.in b/dlls/msvcr70/Makefile.in
index e6dd41b32a54..4c443ecd7f62 100644
--- a/dlls/msvcr70/Makefile.in
+++ b/dlls/msvcr70/Makefile.in
@@ -33,6 +33,7 @@ C_SRCS = \
onexit.c \
process.c \
scanf.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcr71/Makefile.in b/dlls/msvcr71/Makefile.in
index 7795ce1ae245..6f51a326c6b8 100644
--- a/dlls/msvcr71/Makefile.in
+++ b/dlls/msvcr71/Makefile.in
@@ -33,6 +33,7 @@ C_SRCS = \
onexit.c \
process.c \
scanf.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcr80/Makefile.in b/dlls/msvcr80/Makefile.in
index 7d11f65b3a37..3e2da5535626 100644
--- a/dlls/msvcr80/Makefile.in
+++ b/dlls/msvcr80/Makefile.in
@@ -33,6 +33,7 @@ C_SRCS = \
onexit.c \
process.c \
scanf.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcr90/Makefile.in b/dlls/msvcr90/Makefile.in
index 9cb511bbe065..4a49fcfd254c 100644
--- a/dlls/msvcr90/Makefile.in
+++ b/dlls/msvcr90/Makefile.in
@@ -33,6 +33,7 @@ C_SRCS = \
onexit.c \
process.c \
scanf.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcrt/Makefile.in b/dlls/msvcrt/Makefile.in
index 486e6f5491bd..16405262fca0 100644
--- a/dlls/msvcrt/Makefile.in
+++ b/dlls/msvcrt/Makefile.in
@@ -38,6 +38,7 @@ C_SRCS = \
process.c \
scanf.c \
scheduler.c \
+ sincos.c \
string.c \
thread.c \
time.c \
diff --git a/dlls/msvcrt/sincos.c b/dlls/msvcrt/sincos.c
new file mode 100644
index 000000000000..1a34c50f0349
--- /dev/null
+++ b/dlls/msvcrt/sincos.c
@@ -0,0 +1,40 @@
+/*
+ * sincos implementation
+ *
+ * Copyright 2021 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#if 0
+#pragma makedep implib
+#endif
+
+#include <math.h>
+
+/* GCC may optimize a pair of sin(), cos() calls to a single sincos() call,
+ * which is not exported by any msvcrt version. */
+
+void sincos(double x, double *s, double *c)
+{
+ *s = sin(x);
+ *c = cos(x);
+}
+
+void sincosf(float x, float *s, float *c)
+{
+ *s = sinf(x);
+ *c = cosf(x);
+}
diff --git a/dlls/ucrtbase/Makefile.in b/dlls/ucrtbase/Makefile.in
index a576cf0250bb..2910016f29f4 100644
--- a/dlls/ucrtbase/Makefile.in
+++ b/dlls/ucrtbase/Makefile.in
@@ -37,6 +37,7 @@ C_SRCS = \
printf.c \
process.c \
scanf.c \
+ sincos.c \
string.c \
thread.c \
time.c \