Skip to content

Commit

Permalink
meson: simplify constructor support check
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilbert committed Oct 3, 2023
1 parent e93c0fa commit 773422a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,7 @@ if cc.has_header('unistd.h')
cfg.set('HAVE_UNISTD_H', '1')
endif
# we use a constructor attr for dcm_init()
code = '''#include<stdio.h>
__attribute__ ((constructor)) void func() { printf("constructor\n"); }
'''
cfg.set(
'HAS_CONSTRUCTOR',
cc.compiles(code, name : 'has constructor attribute')
)
cfg.set('HAS_CONSTRUCTOR', cc.has_function_attribute('constructor'))

configure_file(
output : 'config.h',
Expand Down

0 comments on commit 773422a

Please sign in to comment.