0001-src-suncalc.cpp-fix-build-with-gcc-6.x.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From ff52cf04c6fa8b3352544447abf429bfa6000dc8 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Sat, 20 Aug 2016 12:13:04 +0200
  4. Subject: [PATCH] src/suncalc.cpp: fix build with gcc 6.x
  5. src/suncalc.cpp currently includes <math.h>, but this causes a build
  6. failure with gcc 6.x, and <cmath> should be used instead. The build
  7. failure is:
  8. /home/test/autobuild/run/instance-0/output/host/usr/arc-buildroot-linux-uclibc/include/c++/6.1.1/cmath:101:37: error: '__is_integer' was not declared in this scope
  9. typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
  10. ^~~~~~~~~~~~
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  12. ---
  13. src/suncalc.cpp | 3 ++-
  14. 1 file changed, 2 insertions(+), 1 deletion(-)
  15. diff --git a/src/suncalc.cpp b/src/suncalc.cpp
  16. index ea2366a..b553f96 100644
  17. --- a/src/suncalc.cpp
  18. +++ b/src/suncalc.cpp
  19. @@ -22,6 +22,8 @@
  20. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. +#include <cmath>
  23. +
  24. #include "suncalc.h"
  25. #include "services.h"
  26. @@ -44,7 +46,6 @@ Released to the public domain by Paul Schlyter, December 1992
  27. #include <stdio.h>
  28. -#include <math.h>
  29. #include <time.h>
  30. #include <stdlib.h>
  31. #include <getopt.h>
  32. --
  33. 2.7.4