From 54449f810079b0d5274481e17a76094916b423a4 Mon Sep 17 00:00:00 2001 From: midipix Date: Dec 25 2018 00:22:49 +0000 Subject: cfgtest.sh: added cfgtest_code_snippet(). --- 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;}' \