Fix CHECK_CODE usage in atomics builtin detection
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>
Mon, 25 Apr 2016 14:10:03 +0000 (16:10 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 25 Apr 2016 23:19:40 +0000 (01:19 +0200)
commit53e0860122c3fa6b9fe80b5693c7b1eee2ad605d
tree21991b106a992e34063cb3ed08cf5e80f918cafc
parentad5a4a9e369248789b08f8ccad51d4d42df71bc9
Fix CHECK_CODE usage in atomics builtin detection

CHECK_CODE already wraps the code with main().  Adding another layer
results in a nested function, eg

  int main(void) { int main(void) { __sync_fetch_and_add(); } }

Since the inner function isn't called it is optimized out at cc -O2,
thus the linker doesn't fail if __sync_fetch_and_add() isn't available.

Issue noticed on OpenBSD/hppa.

Signed-off-by: Jérémie Courrèges-Anglas <jca@wxcvbn.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 26 01:19:40 CEST 2016 on sn-devel-144
lib/replace/wscript