From f66c30c7adb4abbbf89dda560b5e125f4db2b78f Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 22 Dec 2018 17:35:24 -0500 Subject: sofort: cfgtest.sh: added cfgtest_code_snippet(). --- sofort/cfgtest.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sofort') diff --git a/sofort/cfgtest.sh b/sofort/cfgtest.sh index 7f1555b..b8821bb 100644 --- a/sofort/cfgtest.sh +++ b/sofort/cfgtest.sh @@ -257,6 +257,26 @@ cfgtest_type_size() } +cfgtest_code_snippet() +{ + mb_internal_cflags='' + mb_internal_test="$@" + + for mb_header in $mb_cfgtest_headers; do + mb_internal_cflags="$mb_internal_cflags --include=$mb_header" + done + + printf '%s' "$mb_internal_test" \ + | $mb_cfgtest_cc -S -xc - -o - \ + $mb_cfgtest_cflags \ + $mb_internal_cflags \ + > /dev/null 2>/dev/null \ + || return 1 + + return 0 +} + + cfgtest_library_presence() { printf 'int main(void){return 0;}' \ -- cgit v1.2.3