Fix includes for FreeBSD and GNU/Hurd
authorDebian OpenCL Maintainers <pkg-opencl-devel@lists.alioth.debian.org>
Mon, 10 Oct 2016 11:38:39 +0000 (12:38 +0100)
committerAndreas Beckmann <anbe@debian.org>
Mon, 10 Oct 2016 11:38:39 +0000 (12:38 +0100)
Gbp-Pq: Name os-compat.patch

lib/CL/pocl_timing.c
tools/patches/khronos_cl.hpp.patch

index 6b97b8d3de05dd6edc96877b95cb5bc5f3c40cce..46e739955bf5ca1aa1fe6a9d783a6ef9a529af01 100644 (file)
@@ -67,10 +67,10 @@ uint64_t pocl_gettimemono_ns() {
   struct timespec timespec;
 # ifdef __linux__
   clock_gettime(CLOCK_MONOTONIC_RAW, &timespec);
-# elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+# elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
   clock_gettime(CLOCK_UPTIME_FAST, &timespec);
 # else
-# warn Using clock_gettime with CLOCK_REALTIME for monotonic clocks
+# warning Using clock_gettime with CLOCK_REALTIME for monotonic clocks
   clock_gettime(CLOCK_REALTIME, &timespec);
 # endif
   return ((timespec.tv_sec * 1000000000UL) + timespec.tv_nsec);
index 7c6b10106ebc794db5e6af746c612be631627a2e..f95bdbfc77da2e10f02d2cda5d8a6238cbf75533 100644 (file)
@@ -15,7 +15,7 @@
  #endif
 
 -#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
-+#if defined(linux) || defined(__APPLE__) || defined(__MACOSX) || defined(__ANDROID__)
++#if defined(linux) || defined(__APPLE__) || defined(__MACOSX) || defined(__ANDROID__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
  #include <alloca.h>
  
 -#include <emmintrin.h>