gigabase-3.83-cpp14.patch 978 B

1234567891011121314151617181920212223242526272829303132333435
  1. This patch fixes GCC6 (C++14) compilation errors. It replaces two invalid macro
  2. calls with correct code in one place. It also removes redefinitions of fmax and
  3. fmin functions which exist in standard library since C++11.
  4. Gentoo-bug: https://bugs.gentoo.org/show_bug.cgi?id=594550
  5. --- a/testddl.cpp
  6. +++ b/testddl.cpp
  7. @@ -102,8 +102,13 @@
  8. REGISTER(Record);
  9. +#if __cplusplus < 201103L
  10. USER_FUNC(sin);
  11. USER_FUNC(cos);
  12. +#else
  13. +static dbUserFunction fsin_descriptor((double (*)(double))&sin, STRLITERAL("sin"));
  14. +static dbUserFunction fcos_descriptor((double (*)(double))&cos, STRLITERAL("cos"));
  15. +#endif
  16. int __cdecl main()
  17. {
  18. --- a/testtimeseries.cpp
  19. +++ b/testtimeseries.cpp
  20. @@ -47,8 +47,10 @@
  21. REGISTER(Stock);
  22. inline int random(unsigned mod) { return rand() % mod; }
  23. +#if __cplusplus < 201103L
  24. inline float fmax(float x, float y) { return x > y ? x : y; }
  25. inline float fmin(float x, float y) { return x < y ? x : y; }
  26. +#endif
  27. int main(int argc, char* argv[])
  28. {