From: Jarkko Hietaniemi Date: Fri, 29 Oct 1999 23:36:19 +0000 (+0000) Subject: Continue what #4494 started; introduce uid and gid formats. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a22e52b96b9903703a79e4a00983091457f7aff2;p=p5sagit%2Fp5-mst-13.2.git Continue what #4494 started; introduce uid and gid formats. p4raw-id: //depot/cfgperl@4495 --- diff --git a/Configure b/Configure index 3bd3a06..559eb24 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sat Oct 30 01:07:44 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Sat Oct 30 02:37:12 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <&4 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h eval $hasstruct case "$d_fs_data_s" in -"$define") echo "Yup, it does." ;; -*) echo "Nope, it doesn't." ;; +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; esac : see if fseeko exists @@ -10346,8 +10348,8 @@ echo "Checking to see if your system supports struct statfs..." >&4 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h eval $hasstruct case "$d_statfs_s" in -"$define") echo "Yup, it does." ;; -*) echo "Nope, it doesn't." ;; +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; esac @@ -10366,8 +10368,8 @@ define) ;; esac case "$d_statfs_f_flags" in -"$define") echo "Yup, it does." ;; -*) echo "Nope, it doesn't." ;; +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; esac : see if _ptr and _cnt from stdio act std @@ -11675,35 +11677,28 @@ case "$gidtype" in *_t) zzz="$gidtype" ;; *) zzz="gid" ;; esac -echo "Checking the sign of $zzz..." >&4 +echo "Checking the size of $zzz..." >&4 cat > try.c < #include int main() { - $gidtype foo = -1; - if (foo < 0) - printf("-1\n"); - else - printf("1\n"); + printf("%d\n", sizeof($gidtype)); } EOCP set try -if eval $compile; then +if eval $compile_ok; then yyy=`./try` case "$yyy" in - '') gidsign=1 - echo "(I can't execute the test program--guessing unsigned.)" >&4 + '') gidsize=4 + echo "(I can't execute the test program--guessing $gidsize.)" >&4 ;; - *) gidsign=$yyy - case "$gidsign" in - 1) echo "Your $zzz is unsigned." ;; - -1) echo "Your $zzz is signed." ;; - esac + *) gidsize=$yyy + echo "Your $zzz size is $gidsize bytes." ;; esac else - gidsign=1 - echo "(I can't compile the test program--guessing unsigned.)" >&4 + gidsize=4 + echo "(I can't compile the test program--guessing $gidsize.)" >&4 fi @@ -11712,60 +11707,38 @@ case "$gidtype" in *_t) zzz="$gidtype" ;; *) zzz="gid" ;; esac -echo "Checking the size of $zzz..." >&4 +echo "Checking the sign of $zzz..." >&4 cat > try.c < #include int main() { - printf("%d\n", sizeof($gidtype)); + $gidtype foo = -1; + if (foo < 0) + printf("-1\n"); + else + printf("1\n"); } EOCP set try -if eval $compile_ok; then +if eval $compile; then yyy=`./try` case "$yyy" in - '') gidsize=4 - echo "(I can't execute the test program--guessing $gidsize.)" >&4 + '') gidsign=1 + echo "(I can't execute the test program--guessing unsigned.)" >&4 ;; - *) gidsize=$yyy - echo "Your $zzz size is $gidsize bytes." + *) gidsign=$yyy + case "$gidsign" in + 1) echo "Your $zzz is unsigned." ;; + -1) echo "Your $zzz is signed." ;; + esac ;; esac else - gidsize=4 - echo "(I can't compile the test program--guessing $gidsize.)" >&4 + gidsign=1 + echo "(I can't compile the test program--guessing unsigned.)" >&4 fi -: see if getgroups exists -set getgroups d_getgrps -eval $inlibc - -: see if setgroups exists -set setgroups d_setgrps -eval $inlibc - - -: Find type of 2nd arg to 'getgroups()' and 'setgroups()' -echo " " -case "$d_getgrps$d_setgrps" in -*define*) - case "$groupstype" in - '') dflt="$gidtype" ;; - *) dflt="$groupstype" ;; - esac - $cat <&4 @@ -11904,64 +11877,81 @@ int main() { uint32_t u = UINT32_MAX; printf("int32_t\n"); #endif -#ifdef INT64 - int64_t i = INT64_MAX; - uint64_t u = UINT64_MAX; - printf("int64_t\n"); -#endif } EOCP -set try -DINT8 -if eval $compile; then - case "`./try$exe_ext`" in - int8_t) i8type=int8_t - u8type=uint8_t - i8size=1 - u8size=1 + +case "$i8type" in +'') case "$charsize" in + 1) i8type=char + u8type="unsigned char" + i8size=$charsize + u8size=$charsize ;; esac -fi + ;; +esac +case "$i8type" in +'') set try -DINT8 + if eval $compile; then + case "`./try$exe_ext`" in + int8_t) i8type=int8_t + u8type=uint8_t + i8size=1 + u8size=1 + ;; + esac + fi + ;; +esac case "$i8type" in -'') i8type=char - u8type="unsigned char" - i8size=$charsize - u8size=$charsize +'') if $test $charsize -ge 1; then + i8type=char + u8type="unsigned char" + i8size=$charsize + u8size=$charsize + fi ;; esac -set try -DINT16 -if eval $compile; then - case "`./try$exe_ext`" in - int16_t) - i16type=int16_t - u16type=uint16_t - i16size=2 - u16size=2 + +case "$i16type" in +'') case "$shortsize" in + 2) i16type=short + u16type="unsigned short" + i16size=$shortsize + u16size=$shortsize ;; esac -fi + ;; +esac +case "$i16type" in +'') set try -DINT16 + if eval $compile; then + case "`./try$exe_ext`" in + int16_t) + i16type=int16_t + u16type=uint16_t + i16size=2 + u16size=2 + ;; + esac + fi + ;; +esac case "$i16type" in -'') i16type=short - u16type="unsigned short" - i16size=$shortsize - u16size=$shortsize +'') if $test $shortsize -ge 2; then + i16type=short + u16type="unsigned short" + i16size=$shortsize + u16size=$shortsize + fi ;; esac -set try -DINT32 -if eval $compile; then - case "`./try$exe_ext`" in - int32_t) - i32type=int32_t - u32type=uint32_t - i32size=4 - u32size=4 - ;; - esac -fi + case "$i32type" in '') case "$longsize" in 4) i32type=long u32type="unsigned long" - i32size=longsize + i32size=$longsize u32size=$longsize ;; *) case "$intsize" in @@ -11975,17 +11965,30 @@ case "$i32type" in esac ;; esac -set try -DINT64 -if eval $compile; then - case "`./try$exe_ext`" in - int64_t) - i64type=int64_t - u64type=uint64_t - i64size=8 - u64size=8 - ;; - esac -fi +case "$i32type" in +'') set try -DINT32 + if eval $compile; then + case "`./try$exe_ext`" in + int32_t) + i32type=int32_t + u32type=uint32_t + i32size=4 + u32size=4 + ;; + esac + fi + ;; +esac +case "$i32type" in +'') if $test $intsize -ge 4; then + i32type=int + u32type="unsigned int" + i32size=$intsize + u32size=$intsize + fi + ;; +esac + case "$i64type" in '') case "$quadtype" in '') ;; @@ -12195,6 +12198,74 @@ case "$ivdformat" in ;; esac + +echo " " +$echo "Checking the format string to be used for gids..." >&4 + +case "$gidsign" in +-1) if $test X"$gidsize" = X"$ivsize"; then + gidformat="$ivdformat" + else + if $test X"$gidsize" = X"$longsize"; then + gidformat='"ld"' + else + if $test X"$gidsize" = X"$intsize"; then + gidformat='"d"' + else + if $test X"$gidsize" = X"$shortsize"; then + gidformat='"hd"' + fi + fi + fi + fi + ;; +*) if $test X"$gidsize" = X"$uvsize"; then + gidformat="$uvuformat" + else + if $test X"$gidsize" = X"$longsize"; then + gidformat='"lu"' + else + if $test X"$gidsize" = X"$intsize"; then + gidformat='"u"' + else + if $test X"$gidsize" = X"$shortsize"; then + gidformat='"hu"' + fi + fi + fi + fi + ;; +esac + +: see if getgroups exists +set getgroups d_getgrps +eval $inlibc + +: see if setgroups exists +set setgroups d_setgrps +eval $inlibc + + +: Find type of 2nd arg to 'getgroups()' and 'setgroups()' +echo " " +case "$d_getgrps$d_setgrps" in +*define*) + case "$groupstype" in + '') dflt="$gidtype" ;; + *) dflt="$groupstype" ;; + esac + $cat <&4 case "$make_set_make" in @@ -13006,67 +13077,106 @@ case "$uidtype" in *_t) zzz="$uidtype" ;; *) zzz="uid" ;; esac -echo "Checking the sign of $zzz..." >&4 +echo "Checking the size of $zzz..." >&4 cat > try.c < #include int main() { - $uidtype foo = -1; - if (foo < 0) - printf("-1\n"); - else - printf("1\n"); + printf("%d\n", sizeof($uidtype)); } EOCP set try -if eval $compile; then +if eval $compile_ok; then yyy=`./try` case "$yyy" in - '') uidsign=1 - echo "(I can't execute the test program--guessing unsigned.)" >&4 + '') uidsize=4 + echo "(I can't execute the test program--guessing $uidsize.)" >&4 ;; - *) uidsign=$yyy - case "$uidsign" in - 1) echo "Your $zzz is unsigned." ;; - -1) echo "Your $zzz is signed." ;; - esac + *) uidsize=$yyy + echo "Your $zzz size is $uidsize bytes." ;; esac else - uidsign=1 - echo "(I can't compile the test program--guessing unsigned.)" >&4 + uidsize=4 + echo "(I can't compile the test program--guessing $uidsize.)" >&4 fi - echo " " case "$uidtype" in *_t) zzz="$uidtype" ;; *) zzz="uid" ;; esac -echo "Checking the size of $zzz..." >&4 +echo "Checking the sign of $zzz..." >&4 cat > try.c < #include int main() { - printf("%d\n", sizeof($uidtype)); + $uidtype foo = -1; + if (foo < 0) + printf("-1\n"); + else + printf("1\n"); } EOCP set try -if eval $compile_ok; then +if eval $compile; then yyy=`./try` case "$yyy" in - '') uidsize=4 - echo "(I can't execute the test program--guessing $uidsize.)" >&4 + '') uidsign=1 + echo "(I can't execute the test program--guessing unsigned.)" >&4 ;; - *) uidsize=$yyy - echo "Your $zzz size is $uidsize bytes." + *) uidsign=$yyy + case "$uidsign" in + 1) echo "Your $zzz is unsigned." ;; + -1) echo "Your $zzz is signed." ;; + esac ;; esac else - uidsize=4 - echo "(I can't compile the test program--guessing $uidsize.)" >&4 + uidsign=1 + echo "(I can't compile the test program--guessing unsigned.)" >&4 fi + + +echo " " +$echo "Checking the format string to be used for uids..." >&4 + +case "$uidsign" in +-1) if $test X"$uidsize" = X"$ivsize"; then + uidformat="$ivdformat" + else + if $test X"$uidsize" = X"$longsize"; then + uidformat='"ld"' + else + if $test X"$uidsize" = X"$intsize"; then + uidformat='"d"' + else + if $test X"$uidsize" = X"$shortsize"; then + uidformat='"hd"' + fi + fi + fi + fi + ;; +*) if $test X"$uidsize" = X"$uvsize"; then + uidformat="$uvuformat" + else + if $test X"$uidsize" = X"$longsize"; then + uidformat='"lu"' + else + if $test X"$uidsize" = X"$intsize"; then + uidformat='"u"' + else + if $test X"$uidsize" = X"$shortsize"; then + uidformat='"hu"' + fi + fi + fi + fi + ;; +esac + : see if dbm.h is available : see if dbmclose exists set dbmclose d_dbmclose @@ -14282,6 +14392,7 @@ full_ar='$full_ar' full_csh='$full_csh' full_sed='$full_sed' gccversion='$gccversion' +gidformat='$gidformat' gidsign='$gidsign' gidsize='$gidsize' gidtype='$gidtype' @@ -14586,6 +14697,7 @@ u64size='$u64size' u64type='$u64type' u8size='$u8size' u8type='$u8type' +uidformat='$uidformat' uidsign='$uidsign' uidsize='$uidsize' uidtype='$uidtype' diff --git a/Porting/Glossary b/Porting/Glossary index 3747aab..edda0cb 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -176,6 +176,10 @@ cf_time (cf_who.U): Holds the output of the "date" command when the configuration file was produced. This is used to tag both config.sh and config_h.SH. +charsize (charsize.U): + This variable contains the value of the CHARSIZE symbol, which + indicates to the C program how many bytes there are in a character. + chgrp (Loc.U): This variable is defined but not used by Configure. The value is a plain '' and is not useful. @@ -755,10 +759,6 @@ d_inetaton (d_inetaton.U): d_int64t (i_inttypes.U): This symbol will be defined if the C compiler supports int64_t. -d_iovec_s (i_sysuio.U): - This variable conditionally defines the HAS_STRUCT_IOVEC symbol, - which indicates that the struct iovec is supported. - d_isascii (d_isascii.U): This variable conditionally defines the HAS_ISASCII constant, which indicates to the C program that isascii() is available. @@ -782,10 +782,6 @@ d_link (d_link.U): This variable conditionally defines HAS_LINK if link() is available to create hard links. -d_llseek (io64.U): - This variable conditionally defines the HAS_LLSEEK symbol, which - indicates to the C program that the llseek() routine is available. - d_locconv (d_locconv.U): This variable conditionally defines HAS_LOCALECONV if localeconv() is available for numeric and monetary formatting conventions. @@ -1636,8 +1632,11 @@ flex (Loc.U): This variable is defined but not used by Configure. The value is a plain '' and is not useful. +fpossize (fpossize.U): + This variable contains the size of a fpostype in bytes. + fpostype (fpostype.U): - This variable defines Fpos_t to be something like fpost_t, long, + This variable defines Fpos_t to be something like fpos_t, long, uint, or whatever type is used to declare file positions in libc. freetype (mallocsrc.U): @@ -1668,6 +1667,9 @@ gccversion (cc.U): indicate whether the compiler is version 1 or 2. This is used in setting some of the default cflags. It is set to '' if not gcc. +gidformat (gidf.U): + This variable contains the format string used for printing a Gid_t. + gidsign (gidsign.U): This variable contains the signedness of a gidtype. 1 for unsigned, -1 for signed. @@ -1729,6 +1731,30 @@ huge (models.U): huge model is not supported, contains the flag to produce large model programs. It is up to the Makefile to use this. +i16size (perlxv.U): + This variable is the size of an I16 in bytes. + +i16type (perlxv.U): + This variable contains the C type used for Perl's I16. + +i32size (perlxv.U): + This variable is the size of an I32 in bytes. + +i32type (perlxv.U): + This variable contains the C type used for Perl's I32. + +i64size (perlxv.U): + This variable is the size of an I64 in bytes. + +i64type (perlxv.U): + This variable contains the C type used for Perl's I64. + +i8size (perlxv.U): + This variable is the size of an I8 in bytes. + +i8type (perlxv.U): + This variable contains the C type used for Perl's I8. + i_arpainet (i_arpainet.U): This variable conditionally defines the I_ARPA_INET symbol, and indicates whether a C program should include . @@ -2144,6 +2170,16 @@ intsize (intsize.U): This variable contains the value of the INTSIZE symbol, which indicates to the C program how many bytes there are in an int. +ivdformat (perlxvf.U): + This variable contains the format string used for printing + a Perl IV as a signed decimal integer. + +ivsize (perlxv.U): + This variable is the size of an IV in bytes. + +ivtype (perlxv.U): + This variable contains the C type used for Perl's IV. + known_extensions (Extensions.U): This variable holds a list of all XS extensions included in the package. @@ -2467,6 +2503,12 @@ nroff (Loc.U): full pathname (if any) of the nroff program. After Configure runs, the value is reset to a plain "nroff" and is not useful. +nvsize (perlxv.U): + This variable is the size of an NV in bytes. + +nvtype (perlxv.U): + This variable contains the C type used for Perl's NV. + o_nonblock (nblock_io.U): This variable bears the symbol value to be used during open() or fcntl() to turn on non-blocking I/O for a file descriptor. If you wish to switch @@ -3077,6 +3119,33 @@ troff (Loc.U): This variable is defined but not used by Configure. The value is a plain '' and is not useful. +u16size (perlxv.U): + This variable is the size of an U16 in bytes. + +u16type (perlxv.U): + This variable contains the C type used for Perl's U16. + +u32size (perlxv.U): + This variable is the size of an U32 in bytes. + +u32type (perlxv.U): + This variable contains the C type used for Perl's U32. + +u64size (perlxv.U): + This variable is the size of an U64 in bytes. + +u64type (perlxv.U): + This variable contains the C type used for Perl's U64. + +u8size (perlxv.U): + This variable is the size of an U8 in bytes. + +u8type (perlxv.U): + This variable contains the C type used for Perl's U8. + +uidformat (uidf.U): + This variable contains the format string used for printing a Uid_t. + uidsign (uidsign.U): This variable contains the signedness of a uidtype. 1 for unsigned, -1 for signed. @@ -3200,6 +3269,24 @@ uuname (Loc.U): This variable is defined but not used by Configure. The value is a plain '' and is not useful. +uvoformat (perlxvf.U): + This variable contains the format string used for printing + a Perl UV as an unsigned octal integer. + +uvsize (perlxv.U): + This variable is the size of a UV in bytes. + +uvtype (perlxv.U): + This variable contains the C type used for Perl's UV. + +uvuformat (perlxvf.U): + This variable contains the format string used for printing + a Perl UV as an unsigned decimal integer. + +uvxformat (perlxvf.U): + This variable contains the format string used for printing + a Perl UV as an unsigned hexadecimal integer. + vendorbin (vendorbin.U): This variable contains the eventual value of the VENDORBIN symbol. It may have a ~ on the front. diff --git a/Porting/config.sh b/Porting/config.sh index f46a1bd..a0f6d31 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -8,7 +8,7 @@ # Package name : perl5 # Source directory : . -# Configuration time: Fri Oct 29 18:38:18 EET DST 1999 +# Configuration time: Sat Oct 30 02:40:27 EET DST 1999 # Configured by : jhi # Target system : osf1 alpha.hut.fi v4.0 878 alpha @@ -56,7 +56,8 @@ ccflags='-pthread -std -DLANGUAGE_C' ccsymbols='__LANGUAGE_C__=1 _LONGLONG=1 LANGUAGE_C=1 SYSTYPE_BSD=1' cf_by='jhi' cf_email='yourname@yourhost.yourplace.com' -cf_time='Fri Oct 29 18:38:18 EET DST 1999' +cf_time='Sat Oct 30 02:40:27 EET DST 1999' +charsize='1' chgrp='' chmod='' chown='' @@ -192,13 +193,11 @@ d_htonl='define' d_index='undef' d_inetaton='define' d_int64t='undef' -d_iovec_s='define' d_isascii='define' d_killpg='define' d_lchown='define' d_ldbl_dig='define' d_link='define' -d_llseek='undef' d_locconv='define' d_lockf='define' d_longdbl='define' @@ -376,12 +375,14 @@ fflushall='undef' find='' firstmakefile='makefile' flex='' +fpossize='8' fpostype='fpos_t' freetype='void' full_ar='/usr/bin/ar' full_csh='/usr/bin/csh' full_sed='/usr/bin/sed' gccversion='' +gidformat='"u"' gidsign='1' gidsize='4' gidtype='gid_t' @@ -395,6 +396,14 @@ h_sysfile='true' hint='recommended' hostcat='cat /etc/hosts' huge='' +i16size='2' +i16type='short' +i32size='4' +i32type='int' +i64size='8' +i64type='long' +i8size='1' +i8type='char' i_arpainet='define' i_bsdioctl='' i_db='define' @@ -484,6 +493,9 @@ installusrbinperl='define' installvendorbin='' installvendorlib='' intsize='4' +ivdformat='"ld"' +ivsize='8' +ivtype='long' known_extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob GDBM_File IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Thread attrs re' ksh='' large='' @@ -548,6 +560,8 @@ nm_opt='-p' nm_so_opt='' nonxs_ext='Errno' nroff='nroff' +nvsize='8' +nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.o' old_pthread_create_joinable='' @@ -665,6 +679,15 @@ touch='touch' tr='tr' trnl='\n' troff='' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned int' +u64size='8' +u64type='unsigned long' +u8size='1' +u8type='unsigned char' +uidformat='"u"' uidsign='1' uidsize='4' uidtype='uid_t' @@ -691,6 +714,11 @@ usevendorprefix='undef' usevfork='false' usrinc='/usr/include' uuname='' +uvoformat='"lo"' +uvsize='8' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' vendorbin='' vendorbinexp='' vendorlib='' diff --git a/Porting/config_H b/Porting/config_H index facfc25..0a961cc 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -17,7 +17,7 @@ /* * Package name : perl5 * Source directory : . - * Configuration time: Fri Oct 29 18:38:18 EET DST 1999 + * Configuration time: Sat Oct 30 02:40:27 EET DST 1999 * Configured by : jhi * Target system : osf1 alpha.hut.fi v4.0 878 alpha */ @@ -984,6 +984,23 @@ */ #define STDCHAR unsigned char /**/ +/* Quad_t: + * This symbol holds the type used for 64-bit integers. + * It can be int, long, long long, int64_t etc... + */ +/* QUADCASE: + * This symbol, if defined, encodes the type of a quad: + * 1 = int, 2 = long, 3 = long long, 4 = int64_t. + */ +/* Uquad_t: + * This symbol holds the type used for unsigned 64-bit integers. + * It can be unsigned int, unsigned long, unsigned long long, + * uint64_t etc... + */ +#define Quad_t long +#define Uquad_t unsigned long +#define QUADCASE 2 + /* HAS_ACCESSX: * This symbol, if defined, indicates that the accessx routine is * available to do extended access checks. @@ -2371,26 +2388,119 @@ #define PERL_PRIfldbl "f" /**/ #define PERL_PRIgldbl "g" /**/ -/* PERL_PRId64: - * This symbol, if defined, contains the string used by stdio to - * format 64-bit decimal numbers (format 'd') for output. +/* IVTYPE: + * This symbol defines the C type used for Perl's IV. */ -/* PERL_PRIu64: - * This symbol, if defined, contains the string used by stdio to - * format 64-bit unsigned decimal numbers (format 'u') for output. +/* UVTYPE: + * This symbol defines the C type used for Perl's UV. */ -/* PERL_PRIo64: - * This symbol, if defined, contains the string used by stdio to - * format 64-bit octal numbers (format 'o') for output. +/* I8TYPE: + * This symbol defines the C type used for Perl's I8. */ -/* PERL_PRIx64: - * This symbol, if defined, contains the string used by stdio to - * format 64-bit hexadecimal numbers (format 'x') for output. +/* U8TYPE: + * This symbol defines the C type used for Perl's U8. + */ +/* I16TYPE: + * This symbol defines the C type used for Perl's I16. + */ +/* U16TYPE: + * This symbol defines the C type used for Perl's U16. + */ +/* I32TYPE: + * This symbol defines the C type used for Perl's I32. + */ +/* U32TYPE: + * This symbol defines the C type used for Perl's U32. + */ +/* I64TYPE: + * This symbol defines the C type used for Perl's I64. + */ +/* U64TYPE: + * This symbol defines the C type used for Perl's U64. + */ +/* NVTYPE: + * This symbol defines the C type used for Perl's NV. + */ +/* IVSIZE: + * This symbol contains the sizeof(IV). + */ +/* UVSIZE: + * This symbol contains the sizeof(UV). + */ +/* I8SIZE: + * This symbol contains the sizeof(I8). + */ +/* U8SIZE: + * This symbol contains the sizeof(U8). + */ +/* I16SIZE: + * This symbol contains the sizeof(I16). + */ +/* U16SIZE: + * This symbol contains the sizeof(U16). */ -#define PERL_PRId64 "ld" /**/ -#define PERL_PRIu64 "lu" /**/ -#define PERL_PRIo64 "lo" /**/ -#define PERL_PRIx64 "lx" /**/ +/* I32SIZE: + * This symbol contains the sizeof(I32). + */ +/* U32SIZE: + * This symbol contains the sizeof(U32). + */ +/* I64SIZE: + * This symbol contains the sizeof(I64). + */ +/* U64SIZE: + * This symbol contains the sizeof(U64). + */ +/* NVSIZE: + * This symbol contains the sizeof(NV). + */ +#define IVTYPE long /**/ +#define UVTYPE unsigned long /**/ +#define I8TYPE char /**/ +#define U8TYPE unsigned char /**/ +#define I16TYPE short /**/ +#define U16TYPE unsigned short /**/ +#define I32TYPE int /**/ +#define U32TYPE unsigned int /**/ +#ifdef Quad_t +#define I64TYPE long /**/ +#define U64TYPE unsigned long /**/ +#endif +#define NVTYPE double /**/ +#define IVSIZE 8 /**/ +#define UVSIZE 8 /**/ +#define I8SIZE 1 /**/ +#define U8SIZE 1 /**/ +#define I16SIZE 2 /**/ +#define U16SIZE 2 /**/ +#define I32SIZE 4 /**/ +#define U32SIZE 4 /**/ +#ifdef Quad_t +#define I64SIZE 8 /**/ +#define U64SIZE 8 /**/ +#endif +#define NVSIZE 8 /**/ + +/* IVdf: + * This symbol defines the format string used for printing a Perl IV + * as a signed decimal integer. + */ +/* UVuf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned decimal integer. + */ +/* UVof: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned octal integer. + */ +/* UVxf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned hexadecimal integer. + */ +#define IVdf "ld" /**/ +#define UVuf "lu" /**/ +#define UVof "lo" /**/ +#define UVxf "lx" /**/ /* SELECT_MIN_BITS: * This symbol holds the minimum number of bits operated by select. @@ -2675,16 +2785,10 @@ */ #define Fpos_t fpos_t /* File position type */ -/* Gid_t_SIGN: - * This symbol holds the signedess of a Gid_t. - * 1 for unsigned, -1 for signed. - */ -#define Gid_t_SIGN 1 /* GID sign */ - -/* Gid_t_SIZE: - * This symbol holds the size of a Gid_t in bytes. +/* Gid_t_f: + * This symbol defines the format string used for printing a Gid_t. */ -#define Gid_t_SIZE 4 /* GID size */ +#define Gid_t_f "u" /**/ /* Gid_t: * This symbol holds the return type of getgid() and the type of @@ -2721,23 +2825,6 @@ */ #define Pid_t pid_t /* PID type */ -/* Quad_t: - * This symbol holds the type used for 64-bit integers. - * It can be int, long, long long, int64_t etc... - */ -/* QUADCASE: - * This symbol, if defined, encodes the type of a quad: - * 1 = int, 2 = long, 3 = long long, 4 = int64_t. - */ -/* Uquad_t: - * This symbol holds the type used for unsigned 64-bit integers. - * It can be unsigned int, unsigned long, unsigned long long, - * uint64_t etc... - */ -#define Quad_t long -#define Uquad_t unsigned long -#define QUADCASE 2 - /* Size_t: * This symbol holds the type used to declare length parameters * for string functions. It is usually size_t, but may be @@ -2746,16 +2833,10 @@ */ #define Size_t size_t /* length paramater for string functions */ -/* Uid_t_SIGN: - * This symbol holds the signedess of a Uid_t. - * 1 for unsigned, -1 for signed. - */ -#define Uid_t_SIGN 1 /* UID sign */ - -/* Uid_t_SIZE: - * This symbol holds the size of a Uid_t in bytes. +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. */ -#define Uid_t_SIZE 4 /* UID size */ +#define Uid_t_f "u" /**/ /* Uid_t: * This symbol holds the type used to declare user ids in the kernel. diff --git a/config_h.SH b/config_h.SH index 65e6eb4..5355052 100644 --- a/config_h.SH +++ b/config_h.SH @@ -998,6 +998,23 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define STDCHAR $stdchar /**/ +/* Quad_t: + * This symbol holds the type used for 64-bit integers. + * It can be int, long, long long, int64_t etc... + */ +/* QUADCASE: + * This symbol, if defined, encodes the type of a quad: + * 1 = int, 2 = long, 3 = long long, 4 = int64_t. + */ +/* Uquad_t: + * This symbol holds the type used for unsigned 64-bit integers. + * It can be unsigned int, unsigned long, unsigned long long, + * uint64_t etc... + */ +#define Quad_t $quadtype +#define Uquad_t $uquadtype +#define QUADCASE $quadcase + /* HAS_ACCESSX: * This symbol, if defined, indicates that the accessx routine is * available to do extended access checks. @@ -2424,6 +2441,30 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- /* UVSIZE: * This symbol contains the sizeof(UV). */ +/* I8SIZE: + * This symbol contains the sizeof(I8). + */ +/* U8SIZE: + * This symbol contains the sizeof(U8). + */ +/* I16SIZE: + * This symbol contains the sizeof(I16). + */ +/* U16SIZE: + * This symbol contains the sizeof(U16). + */ +/* I32SIZE: + * This symbol contains the sizeof(I32). + */ +/* U32SIZE: + * This symbol contains the sizeof(U32). + */ +/* I64SIZE: + * This symbol contains the sizeof(I64). + */ +/* U64SIZE: + * This symbol contains the sizeof(U64). + */ /* NVSIZE: * This symbol contains the sizeof(NV). */ @@ -2442,6 +2483,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define NVTYPE $nvtype /**/ #define IVSIZE $ivsize /**/ #define UVSIZE $uvsize /**/ +#define I8SIZE $i8size /**/ +#define U8SIZE $u8size /**/ +#define I16SIZE $i16size /**/ +#define U16SIZE $u16size /**/ +#define I32SIZE $i32size /**/ +#define U32SIZE $u32size /**/ #ifdef Quad_t #define I64SIZE $i64size /**/ #define U64SIZE $u64size /**/ @@ -2752,16 +2799,10 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Fpos_t $fpostype /* File position type */ -/* Gid_t_SIGN: - * This symbol holds the signedess of a Gid_t. - * 1 for unsigned, -1 for signed. - */ -#define Gid_t_SIGN $gidsign /* GID sign */ - -/* Gid_t_SIZE: - * This symbol holds the size of a Gid_t in bytes. +/* Gid_t_f: + * This symbol defines the format string used for printing a Gid_t. */ -#define Gid_t_SIZE $gidsize /* GID size */ +#define Gid_t_f $gidformat /**/ /* Gid_t: * This symbol holds the return type of getgid() and the type of @@ -2798,23 +2839,6 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Pid_t $pidtype /* PID type */ -/* Quad_t: - * This symbol holds the type used for 64-bit integers. - * It can be int, long, long long, int64_t etc... - */ -/* QUADCASE: - * This symbol, if defined, encodes the type of a quad: - * 1 = int, 2 = long, 3 = long long, 4 = int64_t. - */ -/* Uquad_t: - * This symbol holds the type used for unsigned 64-bit integers. - * It can be unsigned int, unsigned long, unsigned long long, - * uint64_t etc... - */ -#define Quad_t $quadtype -#define Uquad_t $uquadtype -#define QUADCASE $quadcase - /* Size_t: * This symbol holds the type used to declare length parameters * for string functions. It is usually size_t, but may be @@ -2823,16 +2847,10 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Size_t $sizetype /* length paramater for string functions */ -/* Uid_t_SIGN: - * This symbol holds the signedess of a Uid_t. - * 1 for unsigned, -1 for signed. - */ -#define Uid_t_SIGN $uidsign /* UID sign */ - -/* Uid_t_SIZE: - * This symbol holds the size of a Uid_t in bytes. +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. */ -#define Uid_t_SIZE $uidsize /* UID size */ +#define Uid_t_f $uidformat /**/ /* Uid_t: * This symbol holds the type used to declare user ids in the kernel. diff --git a/handy.h b/handy.h index cd94988..19f589f 100644 --- a/handy.h +++ b/handy.h @@ -108,13 +108,14 @@ typedef I16TYPE I16; typedef U16TYPE U16; typedef I32TYPE I32; typedef U32TYPE U32; -typedef I32TYPE I32; -typedef U32TYPE U32; #ifdef Quad_t typedef I64TYPE I64; typedef U64TYPE U64; #endif +/* Mention I8SIZE, U8SIZE, I16SIZE, U16SIZE, I32SIZE, U32SIZE, + I64SIZE, and U64SIZE here so that metaconfig pulls them in. */ + #if defined(UINT8_MAX) && defined(INT16_MAX) && defined(INT32_MAX) /* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type. diff --git a/perl.h b/perl.h index 06db406..372c0a4 100644 --- a/perl.h +++ b/perl.h @@ -901,8 +901,8 @@ Free_t Perl_mfree (Malloc_t where); --Andy Dougherty August 1996 */ -typdef IVTYPE IV; -typdef UVTYPE UV; +typedef IVTYPE IV; +typedef UVTYPE UV; #ifdef USE_64_BITS # if QUADCASE == 4 && defined(INT64_MAX) /* quad is int64_t */ @@ -1048,7 +1048,7 @@ typdef UVTYPE UV; # endif #endif -typdef NVTYPE NV; +typedef NVTYPE NV; #ifdef USE_LONG_DOUBLE # define NV_DIG LDBL_DIG @@ -1845,84 +1845,6 @@ typedef I32 CHECKPOINT; # endif #endif -/* The Uid_t_f and Gid_t_f definitely look like a job for metaconfig. */ - -#if Uid_t_SIGN == -1 -# if Uid_t_SIZE == IVSIZE -# define Uid_t_f IVdf -# else -# if Uid_t_SIZE == LONGSIZE -# define Uid_t_f "ld" -# else -# if Uid_t_SIZE == INTSIZE -# define Uid_t_f "d" -# else -# if Uid_t_SIZE == SHORTSIZE -# define Uid_t_f "hd" -# else - /* You tell me. */ -# endif -# endif -# endif -# endif -#else -# if Uid_t_SIZE == UVSIZE -# define Uid_t_f UVuf -# else -# if Uid_t_SIZE == LONGSIZE -# define Uid_t_f "lu" -# else -# if Uid_t_SIZE == INTSIZE -# define Uid_t_f "u" -# else -# if Uid_t_SIZE == SHORTSIZE -# define Uid_t_f "hu" -# else - /* You tell me. */ -# endif -# endif -# endif -# endif -#endif - -#if Gid_t_SIGN == -1 -# if Gid_t_SIZE == IVSIZE -# define Gid_t_f IVdf -# else -# if Gid_t_SIZE == LONGSIZE -# define Gid_t_f "ld" -# else -# if Gid_t_SIZE == INTSIZE -# define Gid_t_f "d" -# else -# if Gid_t_SIZE == SHORTSIZE -# define Gid_t_f "hd" -# else - /* You tell me. */ -# endif -# endif -# endif -# endif -#else -# if Gid_t_SIZE == UVSIZE -# define Gid_t_f UVuf -# else -# if Gid_t_SIZE == LONGSIZE -# define Gid_t_f "lu" -# else -# if Gid_t_SIZE == INTSIZE -# define Gid_t_f "u" -# else -# if Gid_t_SIZE == SHORTSIZE -# define Gid_t_f "hu" -# else - /* You tell me. */ -# endif -# endif -# endif -# endif -#endif - /* Used with UV/IV arguments: */ /* XXXX: need to speed it up */ #define CLUMP_2UV(iv) ((iv) < 0 ? 0 : (UV)(iv))