From: Jelmer Vernooij Date: Sat, 8 Nov 2014 16:22:30 +0000 (+0000) Subject: Don't use a nested function when testing for visibility attribute support. X-Git-Tag: samba-4.2.0rc5~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94aceede403e5f7e9d56758aa0f54e1b4ca59a08;p=thirdparty%2Fsamba.git Don't use a nested function when testing for visibility attribute support. Some compilers support __attribute__((visibility)), but not nested functions (e.g. http://www.cprover.org/goto-cc/) Change-Id: I01a5dd6f5f913664621c4090e2dca177527436bb Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749983 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749985 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749986 Signed-Off-By: Jelmer Vernooij Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Mon Nov 10 08:29:19 CET 2014 on sn-devel-104 (cherry picked from commit 2afc5b797826780c07e04ed153edc82f410668a2) --- diff --git a/lib/replace/wscript b/lib/replace/wscript index 16fd50b7b54..7bbe1d6de1e 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -639,10 +639,10 @@ removeea setea if conf.CHECK_CFLAGS('-fvisibility=hidden'): conf.env.VISIBILITY_CFLAGS = '-fvisibility=hidden' - conf.CHECK_CODE('''void vis_foo1(void) {} + conf.CHECK_CODE('''int main(void) { return 0; } __attribute__((visibility("default"))) void vis_foo2(void) {}''', cflags=conf.env.VISIBILITY_CFLAGS, - define='HAVE_VISIBILITY_ATTR') + define='HAVE_VISIBILITY_ATTR', addmain=False) # look for a method of finding the list of network interfaces for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']: