You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-db/gigabase/files/gigabase-3.83-cpp14.patch

35 lines
978 B

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[])
{