1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
  
     | 
    
      #!/bin/sh
# float_t is not an abi type thus convert it to ABI type float, double or double_t at build time
# this is used for symbols file
set -e
dir="$(mktemp -d)"
trap 'rm -rf -- "$dir"' EXIT
cat > $dir/float.c <<"EOF"
#include <math.h>
#include <stdio.h>
int main()
{
    switch(sizeof(float_t)) {
	case(sizeof(float)):
	    printf("float");
	    return 0;
        case(sizeof(double)):
            printf("double");
            return 0;
        case(sizeof(long double)):
            printf("long double");
	    return 0;
        default:
            printf("????");
            return 1;
    }
}
EOF
gcc -o $dir/float -lm $dir/float.c
$dir/float
 
     |