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_strtouq: Inlibc cat Compile run
11 ?S: This variable conditionally defines the HAS_STRTOUQ symbol, which
12 ?S: indicates to the C program that the strtouq() routine is available.
15 ?C: This symbol, if defined, indicates that the strtouq routine is
16 ?C: available to convert strings to unsigned long longs (quads).
18 ?H:#$d_strtouq HAS_STRTOUQ /**/
21 : see if strtouq exists
28 Checking whether your strtouq() works okay...
33 extern unsigned long long int strtouq(char *s, char **, int);
35 void check(char *s, unsigned long long eull, int een) {
36 unsigned long long gull;
38 gull = strtouq(s, 0, 10);
39 if (!((gull == eull) && (errno == een)))
45 check("18446744073709551615", 18446744073709551615ULL, 0);
46 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
47 #if 0 /* strtouq() for /^-/ strings is undefined. */
48 check("-1", 18446744073709551615ULL, 0);
49 check("-18446744073709551614", 2LL, 0);
50 check("-18446744073709551615", 1LL, 0);
51 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
52 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
60 if eval $compile; then
61 case "`$run ./try`" in
62 ok) echo "Your strtouq() seems to be working okay." ;;
64 Your strtouq() doesn't seem to be working okay.
70 echo "(I can't seem to compile the test program--assuming it doesn't)"