$OpenBSD: patch-lib_replace_wscript,v 1.5 2016/04/27 08:50:03 jca Exp $

Fix __sync_fetch_and_add check so that it properly fails instead of
succeeding erroneously (eg on hppa).

Committed upstream:
  https://git.samba.org/?p=samba.git;a=commit;h=53e0860122c3fa6b9fe80b5693c7b1eee2ad605d

--- lib/replace/wscript.orig	Wed Apr 13 17:18:37 2016
+++ lib/replace/wscript	Wed Apr 13 17:18:37 2016
@@ -202,23 +202,15 @@ def configure(conf):
 
     # Check for atomic builtins. */
     conf.CHECK_CODE('''
-                    int main(void) {
                         int i;
                         (void)__sync_fetch_and_add(&i, 1);
-                        return 0;
-                    }
                     ''',
                     'HAVE___SYNC_FETCH_AND_ADD',
                     msg='Checking for __sync_fetch_and_add compiler builtin')
 
     conf.CHECK_CODE('''
-                    #include <stdint.h>
-                    #include <sys/atomic.h>
-                    int main(void) {
                         int32_t i;
                         atomic_add_32(&i, 1);
-                        return 0;
-                    }
                     ''',
                     'HAVE_ATOMIC_ADD_32',
                     headers='stdint.h sys/atomic.h',
