summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-22 17:35:24 -0500
committermidipix <writeonce@midipix.org>2018-12-22 19:14:28 -0500
commitcbf55d337c89e8822e7e98b93b528127aa7c4cab (patch)
tree4b188c462412e9227ae8d1ddc59bb55e75b9fa72
parenta4a46b7e65bcc92f177e5fcb5970655fbe5e95de (diff)
downloadsbpython3-cbf55d337c89e8822e7e98b93b528127aa7c4cab.tar.bz2
sbpython3-cbf55d337c89e8822e7e98b93b528127aa7c4cab.tar.xz
sofort: cfgtest.sh: added cfgtest_code_snippet().
-rw-r--r--sofort/cfgtest.sh20
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;}' \