forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gigabase-3.83-cpp14.patch
34 lines (28 loc) · 978 Bytes
/
gigabase-3.83-cpp14.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
This patch fixes GCC6 (C++14) compilation errors. It replaces two invalid macro
calls with correct code in one place. It also removes redefinitions of fmax and
fmin functions which exist in standard library since C++11.
Gentoo-bug: https://bugs.gentoo.org/show_bug.cgi?id=594550
--- a/testddl.cpp
+++ b/testddl.cpp
@@ -102,8 +102,13 @@
REGISTER(Record);
+#if __cplusplus < 201103L
USER_FUNC(sin);
USER_FUNC(cos);
+#else
+static dbUserFunction fsin_descriptor((double (*)(double))&sin, STRLITERAL("sin"));
+static dbUserFunction fcos_descriptor((double (*)(double))&cos, STRLITERAL("cos"));
+#endif
int __cdecl main()
{
--- a/testtimeseries.cpp
+++ b/testtimeseries.cpp
@@ -47,8 +47,10 @@
REGISTER(Stock);
inline int random(unsigned mod) { return rand() % mod; }
+#if __cplusplus < 201103L
inline float fmax(float x, float y) { return x > y ? x : y; }
inline float fmin(float x, float y) { return x < y ? x : y; }
+#endif
int main(int argc, char* argv[])
{