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_strtoull: Inlibc d_longlong Compile cat run
11 ?S: This variable conditionally defines the HAS_STRTOULL symbol, which
12 ?S: indicates to the C program that the strtoull() routine is available.
15 ?C: This symbol, if defined, indicates that the strtoull routine is
16 ?C: available to convert strings to unsigned long longs.
18 ?H:#$d_strtoull HAS_STRTOULL /**/
21 : see if strtoull exists
22 set strtoull d_strtoull
25 case "$d_longlong-$d_strtoull" in
28 Checking whether your strtoull() works okay...
33 #define strtoull __strtoull
36 extern unsigned long long int strtoull(char *s, char **, int);
38 int check(char *s, long long eull, int een) {
41 gull = strtoull(s, 0, 10);
42 if (!((gull == eull) && (errno == een)))
48 check("18446744073709551615", 18446744073709551615ULL, 0);
49 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
50 #if 0 /* strtoull() for /^-/ strings is undefined. */
51 check("-1", 18446744073709551615ULL, 0);
52 check("-18446744073709551614", 2LL, 0);
53 check("-18446744073709551615", 1LL, 0);
54 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
55 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
62 if eval $compile; then
63 case "`$run ./try`" in
64 ok) echo "Your strtoull() seems to be working okay." ;;
66 Your strtoull() doesn't seem to be working okay.
72 echo "(I can't seem to compile the test program--assuming it doesn't)"