From 96bcd25021135928929e629fb9d3a86571e11e26 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 16 Oct 2018 20:01:52 -0700 Subject: Add mechanism to probe for size of type --- scripts/probe-size.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/probe-size.sh (limited to 'scripts') diff --git a/scripts/probe-size.sh b/scripts/probe-size.sh new file mode 100644 index 00000000..eabfe3b9 --- /dev/null +++ b/scripts/probe-size.sh @@ -0,0 +1,13 @@ +set -e + +var=$1 +shift +for size in 8 4 2 1 ; do + if "$@" -D "$var=$size" 2>/dev/null ; then + echo "#define $var $size" + exit 0 + fi +done + +printf "%s: could not determine %s\n" "$0" "$var" >&2 +exit 1 -- cgit v1.2.3