Skip to content

Commit

Permalink
Add inline and long long checking
Browse files Browse the repository at this point in the history
This fixes 'defined but not used' errors for JSON_INLINE functions.
  • Loading branch information
woelfman authored and sarum9in committed Jan 2, 2019
1 parent 4ea3e9f commit e57b276
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,25 @@ foreach f : check_functions
endif
endforeach

foreach f : ['inline', '__inline', '']
if cc.compiles(f + ' void func() {}')
cdata.set('json_inline', f)
break
endif
endforeach

if cc.sizeof('long long int') > 0
cdata.set('json_have_long_long', 1)
cdata.set('HAVE_LONG_LONG_INT', 1)
else
cdata.set('json_have_long_long', 0)
endif

# FIXME: These variables set features to be explicitly disabled. The tests for
# these are missing from the check_functions block above and are also prefixed
# by 'json_'. Also these are used by an extra 'src/jansson_config.h.in' file.
# This means we may miss out on some platform specific performance improvemnts.
cdata.set('var', 'var') # avoid warning; bogus variable found in comment.
cdata.set('json_inline', '')
cdata.set('json_have_long_long', 0)
cdata.set('json_have_localeconv', 0)
cdata.set('json_have_atomic_builtins', 0)
cdata.set('json_have_sync_builtins', 0)
Expand Down

0 comments on commit e57b276

Please sign in to comment.