diff options
author | midipix <writeonce@midipix.org> | 2018-12-22 17:35:24 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-12-24 19:22:49 -0500 |
commit | 54449f810079b0d5274481e17a76094916b423a4 (patch) | |
tree | e84e2c13bf2dddb325f81166ef1a8167b04d5bfb | |
parent | e5f78aecc18f98288d14f568b052c8a8b35c0eff (diff) | |
download | sofort-54449f810079b0d5274481e17a76094916b423a4.tar.bz2 sofort-54449f810079b0d5274481e17a76094916b423a4.tar.xz |
cfgtest.sh: added cfgtest_code_snippet().
-rw-r--r-- | sofort/cfgtest.sh | 20 |
1 files changed, 20 insertions, 0 deletions
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;}' \ |