File: test_float_t.sh

package info (click to toggle)
imagemagick 8%3A7.1.2.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 86,336 kB
  • sloc: ansic: 373,543; cpp: 22,660; xml: 11,570; sh: 6,618; perl: 6,285; makefile: 3,498; tcl: 459
file content (34 lines) | stat: -rwxr-xr-x 657 bytes parent folder | download | duplicates (4)
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