3 ?RCS: Copyright (c) 2000 Jarkko Hietaniemi
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
8 ?MAKE:d_strtoll: Inlibc d_longlong Compile cat run
11 ?S: This variable conditionally defines the HAS_STRTOLL symbol, which
12 ?S: indicates to the C program that the strtoll() routine is available.
15 ?C: This symbol, if defined, indicates that the strtoll routine is
16 ?C: available to convert strings to long longs.
18 ?H:#$d_strtoll HAS_STRTOLL /**/
22 : see if strtoll exists
26 case "$d_longlong-$d_strtoll" in
29 Checking whether your strtoll() works okay...
34 #define strtoll __strtoll
37 #define strtoll _strtoll
40 extern long long int strtoll(char *s, char **, int);
42 int check(char *s, long long ell, int een) {
45 gll = strtoll(s, 0, 10);
46 if (!((gll == ell) && (errno == een)))
53 check("-9223372036854775808", -9223372036854775808LL, 0);
54 check("-9223372036854775808", -9223372036854775808LL, 0);
55 check(" 9223372036854775807", 9223372036854775807LL, 0);
56 check("-9223372036854775808", -9223372036854775808LL, 0);
57 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
58 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
64 if eval $compile; then
67 ok) echo "Your strtoll() seems to be working okay." ;;
69 Your strtoll() doesn't seem to be working okay.
75 echo "(I can't seem to compile the test program--assuming it doesn't)"