# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Dec 13 17:45:13 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Fri Dec 15 04:41:40 EET 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
d_strtol=''
d_strtold=''
d_strtoll=''
+d_strtoq=''
d_strtoul=''
d_strtoull=''
d_strtouq=''
;;
esac
+: see if strtoq exists
+set strtoq d_strtoq
+eval $inlibc
+
: see if strtoul exists
set strtoul d_strtoul
eval $inlibc
+case "$d_strtoul" in
+"$define")
+ $cat <<EOM
+Checking whether your strtoul() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#include <stdio.h>
+extern unsigned long int strtoul(char *s, char **, int);
+static int bad = 0;
+void check(char *s, unsigned long eul, int een) {
+ unsigned long gul;
+ errno = 0;
+ gul = strtoul(s, 0, 10);
+ if (!((gul == eul) && (errno == een)))
+ bad++;
+}
+int main() {
+ check(" 1", 1L, 0);
+ check(" 0", 0L, 0);
+EOCP
+ case "$longsize" in
+ 8)
+ $cat >>try.c <<'EOCP'
+ check("18446744073709551615", 18446744073709551615ULL, 0);
+ check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-1", 18446744073709551615ULL, 0);
+ check("-18446744073709551614", 2, 0);
+ check("-18446744073709551615", 1, 0);
+ check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
+EOCP
+ ;;
+ 4)
+ $cat >>try.c <<'EOCP'
+ check("4294967295", 4294967295UL, 0);
+ check("4294967296", 4294967295UL, ERANGE);
+ check("-1", 4294967295UL, 0);
+ check("-4294967294", 2, 0);
+ check("-4294967295", 1, 0);
+ check("-4294967296", 4294967295UL, ERANGE);
+ check("-4294967297", 4294967295UL, ERANGE);
+EOCP
+ ;;
+ *)
+: Should we write these tests to be more portable by sprintf-ing
+: ~0 and then manipulating that char string as input for strtol?
+ ;;
+ esac
+ $cat >>try.c <<'EOCP'
+ if (!bad)
+ printf("ok\n");
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`./try`" in
+ ok) echo "Your strtoul() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtoul() doesn't seem to be working okay.
+EOM
+ d_strtoul="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strtoull exists
set strtoull d_strtoull
eval $inlibc
bad++;
}
int main() {
- check(" 1", 1LL, 0);
- check(" 0", 0LL, 0);
- check("18446744073709551615", 18446744073709551615ULL, 0);
- check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check(" 1", 1LL, 0);
+ check(" 0", 0LL, 0);
+ check("18446744073709551615", 18446744073709551615ULL, 0);
+ check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-1", 18446744073709551615ULL, 0);
+ check("-18446744073709551614", 2LL, 0);
+ check("-18446744073709551615", 1LL, 0);
+ check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
if (!bad)
printf("ok\n");
}
set strtouq d_strtouq
eval $inlibc
+case "$d_strtouq" in
+"$define")
+ $cat <<EOM
+Checking whether your strtouq() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#include <stdio.h>
+extern unsigned long long int strtouq(char *s, char **, int);
+static int bad = 0;
+void check(char *s, unsigned long long eull, int een) {
+ unsigned long long gull;
+ errno = 0;
+ gull = strtouq(s, 0, 10);
+ if (!((gull == eull) && (errno == een)))
+ bad++;
+}
+int main() {
+ check(" 1", 1LL, 0);
+ check(" 0", 0LL, 0);
+ check("18446744073709551615", 18446744073709551615ULL, 0);
+ check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-1", 18446744073709551615ULL, 0);
+ check("-18446744073709551614", 2LL, 0);
+ check("-18446744073709551615", 1LL, 0);
+ check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
+ if (!bad)
+ printf("ok\n");
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`./try`" in
+ ok) echo "Your strtouq() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtouq() doesn't seem to be working okay.
+EOM
+ d_strtouq="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strxfrm exists
set strxfrm d_strxfrm
eval $inlibc
d_strtol='$d_strtol'
d_strtold='$d_strtold'
d_strtoll='$d_strtoll'
+d_strtoq='$d_strtoq'
d_strtoul='$d_strtoul'
d_strtoull='$d_strtoull'
d_strtouq='$d_strtouq'
This variable conditionally defines the HAS_STRTOLL symbol, which
indicates to the C program that the strtoll() routine is available.
+d_strtoq (d_strtoq.U):
+ This variable conditionally defines the HAS_STRTOQ symbol, which
+ indicates to the C program that the strtoq() routine is available.
+
d_strtoul (d_strtoul.U):
This variable conditionally defines the HAS_STRTOUL symbol, which
indicates to the C program that the strtoul() routine is available
# Package name : perl5
# Source directory : /m/fs/work/work/permanent/perl/pp4/perl
-# Configuration time: Tue Nov 21 20:44:07 EET 2000
+# Configuration time: Fri Dec 15 04:43:47 EET 2000
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
ccversion='V5.6-082'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Tue Nov 21 20:44:07 EET 2000'
+cf_time='Fri Dec 15 04:43:47 EET 2000'
charsize='1'
chgrp=''
chmod=''
d_strtol='define'
d_strtold='undef'
d_strtoll='undef'
-d_strtoul='define'
+d_strtoq='undef'
+d_strtoul='undef'
d_strtoull='undef'
d_strtouq='undef'
d_strxfrm='define'
dlsrc='dl_dlopen.xs'
doublesize='8'
drand01='drand48()'
-dynamic_ext='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Encode Fcntl File/Glob IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread attrs re'
+dynamic_ext='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Encode Fcntl File/Glob Filter/Util/Call IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread attrs re'
eagain='EAGAIN'
ebcdic='undef'
echo='echo'
eunicefix=':'
exe_ext=''
expr='expr'
-extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Encode Fcntl File/Glob IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread attrs re Errno'
+extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Encode Fcntl File/Glob Filter/Util/Call IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread attrs re Errno'
fflushNULL='define'
fflushall='undef'
find=''
ivdformat='"ld"'
ivsize='8'
ivtype='long'
-known_extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Encode Fcntl File/Glob GDBM_File IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread attrs re'
+known_extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Encode Fcntl File/Glob Filter/Util/Call GDBM_File IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread attrs re'
ksh=''
ld='ld'
lddlflags='-shared -expect_unresolved "*" -msym -std -s'
/*
* Package name : perl5
* Source directory : /m/fs/work/work/permanent/perl/pp4/perl
- * Configuration time: Tue Nov 21 20:44:07 EET 2000
+ * Configuration time: Fri Dec 15 04:43:47 EET 2000
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
*/
#define HAS_STRTOL /**/
-/* HAS_STRTOUL:
- * This symbol, if defined, indicates that the strtoul routine is
- * available to provide conversion of strings to unsigned long.
- */
-#define HAS_STRTOUL /**/
-
/* HAS_STRXFRM:
* This symbol, if defined, indicates that the strxfrm() routine is
* available to transform strings.
*/
#define SH_PATH "/bin/sh" /**/
-/* STDCHAR:
- * This symbol is defined to be the type of char used in stdio.h.
- * It has the values "unsigned char" or "char".
- */
-#define STDCHAR unsigned char /**/
-
/* CROSSCOMPILE:
* This symbol, if defined, signifies that we our
* build process is a cross-compilation.
*/
/*#define HAS_STRTOLL / **/
+/* HAS_STRTOQ:
+ * This symbol, if defined, indicates that the strtoq routine is
+ * available to convert strings to long longs (quads).
+ */
+/*#define HAS_STRTOQ / **/
+
/* HAS_STRTOULL:
* This symbol, if defined, indicates that the strtoull routine is
* available to convert strings to unsigned long longs.
#define HAS_SETPGRP /**/
#define USE_BSD_SETPGRP /**/
+/* HAS_STRTOUL:
+ * This symbol, if defined, indicates that the strtoul routine is
+ * available to provide conversion of strings to unsigned long.
+ */
+/*#define HAS_STRTOUL / **/
+
+/* STDCHAR:
+ * This symbol is defined to be the type of char used in stdio.h.
+ * It has the values "unsigned char" or "char".
+ */
+#define STDCHAR unsigned char /**/
+
/* HAS__FWALK:
* This symbol, if defined, indicates that the _fwalk system call is
* available to apply a function to all the file handles.
*/
#$d_strtol HAS_STRTOL /**/
-/* HAS_STRTOUL:
- * This symbol, if defined, indicates that the strtoul routine is
- * available to provide conversion of strings to unsigned long.
- */
-#$d_strtoul HAS_STRTOUL /**/
-
/* HAS_STRXFRM:
* This symbol, if defined, indicates that the strxfrm() routine is
* available to transform strings.
*/
#$d_strtoll HAS_STRTOLL /**/
+/* HAS_STRTOQ:
+ * This symbol, if defined, indicates that the strtoq routine is
+ * available to convert strings to long longs (quads).
+ */
+#$d_strtoq HAS_STRTOQ /**/
+
/* HAS_STRTOULL:
* This symbol, if defined, indicates that the strtoull routine is
* available to convert strings to unsigned long longs.
#$d_setpgrp HAS_SETPGRP /**/
#$d_bsdsetpgrp USE_BSD_SETPGRP /**/
+/* HAS_STRTOUL:
+ * This symbol, if defined, indicates that the strtoul routine is
+ * available to provide conversion of strings to unsigned long.
+ */
+#$d_strtoul HAS_STRTOUL /**/
+
/* STDCHAR:
* This symbol is defined to be the type of char used in stdio.h.
* It has the values "unsigned char" or "char".
$ GOSUB inlibc
$ d_strtoll = tmp
$!
+$! Check for strtoq
+$!
+$ OS
+$ WS "#if defined(__DECC) || defined(__DECCXX)"
+$ WS "#include <stdlib.h>"
+$ WS "#endif"
+$ WS "#include <string.h>"
+$ WS "int main()"
+$ WS "{"
+$ WS "__int64 result;"
+$ WS "result = strtoq(""123123"", NULL, 10);"
+$ WS "exit(0);"
+$ WS "}"
+$ CS
+$ tmp = "strtoq"
+$ GOSUB inlibc
+$ d_strtoq = tmp
+$!
$! Check for strtold
$!
$ OS
$ WC "d_strtol='define'"
$ WC "d_strtold='" + d_strtold + "'"
$ WC "d_strtoll='" + d_strtoll + "'"
+$ WC "d_strtoq='define'"
$ WC "d_strtoul='define'"
$ WC "d_strtoull='" + d_strtoull + "'"
$ WC "d_strtouq='" + d_strtouq + "'"
d_strerror='define'
d_strtod='define'
d_strtol='define'
+d_strtoq='undef'
d_strtoul='define'
+d_strtouq='undef'
d_strtoull='undef'
d_strxfrm='define'
d_suidsafe='undef'
# if !defined(Strtol) && defined(HAS_STRTOLL)
# define Strtol strtoll
# endif
+# if !defined(Strtol) && defined(HAS_STRTOQ)
+# define Strtol strtoq
+# endif
/* is there atoq() anywhere? */
#endif
#if !defined(Strtol) && defined(HAS_STRTOL)
s++;
} while (isDIGIT(*s));
- if (s - nbegin > TYPE_DIGITS(UV)) /* Cannot cache ato[ul]() */
+ /* Aaargh. long long really is irritating.
+ In the gospel according to ANSI 1989, it is an axiom that "long"
+ is the longest integer type, and that if you don't know how long
+ something is you can cast it to long, and nothing will be lost
+ (except possibly speed of execution if long is slower than the
+ type is was).
+ Now, one can't be sure if the old rules apply, or long long
+ (or some other newfangled thing) is actually longer than the
+ (formerly) longest thing.
+ */
+ /* This lot will work for 64 bit *as long as* either
+ either long is 64 bit
+ or we can find both strtol/strtoq and strtoul/strtouq
+ If not, we really should refuse to let the user use 64 bit IVs
+ By "64 bit" I really mean IVs that don't get preserved by NVs
+ It also should work for 128 bit IVs. Can any lend me a machine to
+ test this?
+ */
+ if (s - nbegin > TYPE_DIGITS(UV)) /* Cannot cache ato[ul]() */
numtype |= IS_NUMBER_TO_INT_BY_ATOF | IS_NUMBER_LONGER_THAN_IV_MAX;
- else if (s - nbegin < BIT_DIGITS(sizeof (IV)*8-1))
+ else if (s - nbegin < BIT_DIGITS(((sizeof (IV)>sizeof (long))
+ ? sizeof(long) : sizeof (IV))*8-1))
numtype |= IS_NUMBER_TO_INT_BY_ATOL;
else
/* Can't be sure either way. (For 64 bit UV, 63 bit IV is 1 decimal
*/
/*#define HAS_STRTOL / **/
-/* HAS_STRTOUL:
- * This symbol, if defined, indicates that the strtoul routine is
- * available to provide conversion of strings to unsigned long.
- */
-/*#define HAS_STRTOUL / **/
-
/* HAS_STRXFRM:
* This symbol, if defined, indicates that the strxfrm() routine is
* available to transform strings.
*/
#define SH_PATH "" /**/
-/* STDCHAR:
- * This symbol is defined to be the type of char used in stdio.h.
- * It has the values "unsigned char" or "char".
- */
-#define STDCHAR char /**/
-
/* CROSSCOMPILE:
* This symbol, if defined, signifies that we our
* build process is a cross-compilation.
*/
/*#define HAS_STRTOLL / **/
+/* HAS_STRTOQ:
+ * This symbol, if defined, indicates that the strtoq routine is
+ * available to convert strings to long longs (quads).
+ */
+# HAS_STRTOQ /**/
+
/* HAS_STRTOULL:
* This symbol, if defined, indicates that the strtoull routine is
* available to convert strings to unsigned long longs.
/*#define HAS_SETPGRP / **/
/*#define USE_BSD_SETPGRP / **/
+/* HAS_STRTOUL:
+ * This symbol, if defined, indicates that the strtoul routine is
+ * available to provide conversion of strings to unsigned long.
+ */
+/*#define HAS_STRTOUL / **/
+
+/* STDCHAR:
+ * This symbol is defined to be the type of char used in stdio.h.
+ * It has the values "unsigned char" or "char".
+ */
+#define STDCHAR char /**/
+
/* HAS__FWALK:
* This symbol, if defined, indicates that the _fwalk system call is
* available to apply a function to all the file handles.
$d_strtol='define'
$d_strtold='undef'
$d_strtoll='undef'
+$d_strtoq='undef'
$d_strtoul='define'
$d_strtoull='undef'
$d_strtouq='undef'
*/
/*#define HAS_STRTOLL /**/
+/* HAS_STRTOQ:
+ * This symbol, if defined, indicates that the strtouq routine is
+ * available to convert strings to long longs (quads).
+ */
+/*#define HAS_STRTOQ /**/
+
/* HAS_STRTOULL:
* This symbol, if defined, indicates that the strtoull routine is
* available to convert strings to unsigned long longs.
$d_strtol='define'
$d_strtold='undef'
$d_strtoll='undef'
+$d_strtoq='undef'
$d_strtoul='define'
$d_strtoull='undef'
$d_strtouq='undef'
*/
#define HAS_STRTOL /**/
+/* HAS_STRTOQ:
+ * This symbol, if defined, indicates that the strtouq routine is
+ * available to convert strings to long longs (quads).
+ */
+/*#define HAS_STRTOQ /**/
+
/* HAS_STRTOUL:
* This symbol, if defined, indicates that the strtoul routine is
* available to provide conversion of strings to unsigned long.
d_strtol='define'
d_strtold='undef'
d_strtoll='undef'
+d_strtoq='undef'
d_strtoul='define'
d_strtoull='undef'
d_strtouq='undef'
d_strtol='define'
d_strtold='undef'
d_strtoll='undef'
+d_strtoq='undef'
d_strtoul='define'
d_strtoull='undef'
d_strtouq='undef'
d_strtol='define'
d_strtold='undef'
d_strtoll='undef'
+d_strtoq='undef'
d_strtoul='define'
d_strtoull='undef'
d_strtouq='undef'