From b919db72e6f1b1d98d0c97f9919b7593af11d0ae Mon Sep 17 00:00:00 2001
From: Jan Beich <jbeich@freebsd.org>
Date: Sat, 13 May 2017 11:21:12 +0200
Subject: [PATCH 2/2] Add prototypes for 64bit atomics fallback

u_atomic.c:67:1: error: no previous prototype for function '__atomic_fetch_add_8'
      [-Werror,-Wmissing-prototypes]
__atomic_fetch_add_8(uint64_t *ptr, uint64_t val, int memorder)
^
u_atomic.c:73:1: error: no previous prototype for function '__atomic_fetch_sub_8'
      [-Werror,-Wmissing-prototypes]
__atomic_fetch_sub_8(uint64_t *ptr, uint64_t val, int memorder)
^
2 errors generated.

Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
---
 src/util/u_atomic.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c
index 691c34cf30..ce600aeeed 100644
--- a/src/util/u_atomic.c
+++ b/src/util/u_atomic.c
@@ -34,6 +34,14 @@
 
 static pthread_mutex_t sync_mutex = PTHREAD_MUTEX_INITIALIZER;
 
+#ifdef USE_GCC_ATOMIC_BUILTINS
+uint64_t __atomic_fetch_add_8(uint64_t *ptr, uint64_t val, int memorder);
+uint64_t __atomic_fetch_sub_8(uint64_t *ptr, uint64_t val, int memorder);
+#else
+uint64_t __sync_add_and_fetch_8(uint64_t *ptr, uint64_t val);
+uint64_t __sync_sub_and_fetch_8(uint64_t *ptr, uint64_t val);
+#endif
+
 #ifndef USE_GCC_ATOMIC_BUILTINS
 WEAK uint64_t
 __sync_add_and_fetch_8(uint64_t *ptr, uint64_t val)
-- 
2.14.1

