This allows us to use them in talloc as well.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
cflags=conf.env.VISIBILITY_CFLAGS,
define='HAVE_VISIBILITY_ATTR', addmain=False)
+ # check HAVE_CONSTRUCTOR_ATTRIBUTE
+ conf.CHECK_CODE('''
+ void test_constructor_attribute(void) __attribute__ ((constructor));
+
+ void test_constructor_attribute(void)
+ {
+ return;
+ }
+
+ int main(void) {
+ return 0;
+ }
+ ''',
+ 'HAVE_CONSTRUCTOR_ATTRIBUTE',
+ addmain=False,
+ msg='Checking for library constructor support')
+
+ # check HAVE_DESTRUCTOR_ATTRIBUTE
+ conf.CHECK_CODE('''
+ void test_destructor_attribute(void) __attribute__ ((destructor));
+
+ void test_destructor_attribute(void)
+ {
+ return;
+ }
+
+ int main(void) {
+ return 0;
+ }
+ ''',
+ 'HAVE_DESTRUCTOR_ATTRIBUTE',
+ addmain=False,
+ msg='Checking for library destructor support')
+
if sys.platform.startswith('aix'):
conf.DEFINE('_ALL_SOURCE', 1, add_to_cflags=True)
# Might not be needed if ALL_SOURCE is defined
addmain=False,
msg='Checking for thread local storage')
- # check HAVE_CONSTRUCTOR_ATTRIBUTE
- conf.CHECK_CODE('''
- void test_constructor_attribute(void) __attribute__ ((constructor));
-
- void test_constructor_attribute(void)
- {
- return;
- }
-
- int main(void) {
- return 0;
- }
- ''',
- 'HAVE_CONSTRUCTOR_ATTRIBUTE',
- addmain=False,
- msg='Checking for library constructor support')
-
- # check HAVE_DESTRUCTOR_ATTRIBUTE
- conf.CHECK_CODE('''
- void test_destructor_attribute(void) __attribute__ ((destructor));
-
- void test_destructor_attribute(void)
- {
- return;
- }
-
- int main(void) {
- return 0;
- }
- ''',
- 'HAVE_DESTRUCTOR_ATTRIBUTE',
- addmain=False,
- msg='Checking for library destructor support')
-
if Options.options.address_sanitizer:
# check HAVE_ADDRESS_SANITIZER_ATTRIBUTE
conf.CHECK_CODE('''
/* Destructor for global context to ensure fd is closed */
-#if HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR
+#if HAVE_DESTRUCTOR_ATTRIBUTE
__attribute__((destructor))
#endif
static void winbind_destructor(void)
conf.env['CTDB_INCLUDE'] = conf.srcdir + '/ctdb/include'
conf.env.with_ctdb = True
- conf.CHECK_CODE('__attribute__((destructor)) static void cleanup(void) { }',
- 'HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR',
- addmain=False,
- link=False,
- msg='Checking whether we can compile with __attribute__((destructor))')
-
conf.CHECK_CODE('void seekdir(DIR *d, long loc) { return; }',
'SEEKDIR_RETURNS_VOID',
headers='sys/types.h dirent.h',