From ae0e3d3b35cf70354d3fdbc894ffe3064a567667 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Fri, 23 Nov 2001 18:09:37 +0000 Subject: [PATCH] Add probing for dirfd() so that it can be added it IO::Dir. p4raw-id: //depot/perl@13211 --- Configure | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------- config_h.SH | 6 ++++++ perl.h | 51 ++++++++++++++++++++++++--------------------- 3 files changed, 93 insertions(+), 33 deletions(-) diff --git a/Configure b/Configure index 0b1b043..87ba29c 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 Thu Nov 22 08:04:01 EET 2001 [metaconfig 3.0 PL70] +# Generated on Fri Nov 23 21:08:41 EET 2001 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <dirfd.c < +#$i_dirent I_DIRENT /**/ +#$i_sysdir I_SYS_DIR /**/ +#$i_sysndir I_SYS_NDIR /**/ +#$i_systypes I_SYS_TYPES /**/ +#if defined(I_SYS_TYPES) +#include +#endif +#if defined(I_DIRENT) +#include +#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ +#include +#endif +#else +#ifdef I_SYS_NDIR +#include +#else +#ifdef I_SYS_DIR +#ifdef hp9000s500 +#include /* may be wrong in the future */ +#else +#include +#endif +#endif +#endif +#endif +int main() { + DIR *dirp = opendir("."); + if (dirfd(dirp) >= 0) + exit(0); + else + exit(1); +} +EOM +set dirfd +if eval $compile; then + val="$define" +fi +case "$val" in +$define) echo "dirfd() found." >&4 ;; +*) echo "dirfd() NOT found." >&4 ;; +esac +set d_dirfd +eval $setvar +$rm -f dirfd* + : see if dlerror exists xxx_runnm="$runnm" runnm=false @@ -13443,14 +13501,6 @@ $define) usevfork='true';; *) usevfork='false';; esac -: see if this is an sysdir system -set sys/dir.h i_sysdir -eval $inhdr - -: see if this is an sysndir system -set sys/ndir.h i_sysndir -eval $inhdr - : see if closedir exists set closedir d_closedir eval $inlibc @@ -16832,6 +16882,7 @@ d_cuserid='$d_cuserid' d_dbl_dig='$d_dbl_dig' d_dbminitproto='$d_dbminitproto' d_difftime='$d_difftime' +d_dirfd='$d_dirfd' d_dirnamlen='$d_dirnamlen' d_dlerror='$d_dlerror' d_dlopen='$d_dlopen' diff --git a/config_h.SH b/config_h.SH index 9b20de6..381d258 100644 --- a/config_h.SH +++ b/config_h.SH @@ -3484,6 +3484,12 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d_dbminitproto HAS_DBMINIT_PROTO /**/ +/* HAS_DIRFD: + * This manifest constant lets the C program know that dirfd + * is available. + */ +#$d_dirfd HAS_DIRFD /**/ + /* HAS_FLOCK_PROTO: * This symbol, if defined, indicates that the system provides * a prototype for the flock() function. Otherwise, it is up diff --git a/perl.h b/perl.h index a1bb275..762ffda 100644 --- a/perl.h +++ b/perl.h @@ -4003,6 +4003,30 @@ extern void moncontrol(int); #define PERL_GPROF_MONCONTROL(x) #endif +#ifdef UNDER_CE +#include "wince.h" +#endif + +/* ISO 6429 NEL - C1 control NExt Line */ +/* See http://www.unicode.org/unicode/reports/tr13/ */ +#ifdef EBCDIC /* In EBCDIC NEL is just an alias for LF */ +# if '^' == 95 /* CP 1047: MVS OpenEdition - OS/390 - z/OS */ +# define NEXT_LINE_CHAR 0x15 +# else /* CDRA */ +# define NEXT_LINE_CHAR 0x25 +# endif +#else +# define NEXT_LINE_CHAR 0x85 +#endif + +/* The UTF-8 bytes of the Unicode LS and PS, U+2028 and U+2029 */ +#define UNICODE_LINE_SEPA_0 0xE2 +#define UNICODE_LINE_SEPA_1 0x80 +#define UNICODE_LINE_SEPA_2 0xA8 +#define UNICODE_PARA_SEPA_0 0xE2 +#define UNICODE_PARA_SEPA_1 0x80 +#define UNICODE_PARA_SEPA_2 0xA9 + /* and finally... */ #define PERL_PATCHLEVEL_H_IMPLICIT #include "patchlevel.h" @@ -4045,31 +4069,10 @@ extern void moncontrol(int); HAS_STRUCT_CMSGHDR HAS_NL_LANGINFO + + HAS_DIRFD so that Configure picks them up. */ -#ifdef UNDER_CE -#include "wince.h" -#endif - -/* ISO 6429 NEL - C1 control NExt Line */ -/* See http://www.unicode.org/unicode/reports/tr13/ */ -#ifdef EBCDIC /* In EBCDIC NEL is just an alias for LF */ -# if '^' == 95 /* CP 1047: MVS OpenEdition - OS/390 - z/OS */ -# define NEXT_LINE_CHAR 0x15 -# else /* CDRA */ -# define NEXT_LINE_CHAR 0x25 -# endif -#else -# define NEXT_LINE_CHAR 0x85 -#endif - -/* The UTF-8 bytes of the Unicode LS and PS, U+2028 and U+2029 */ -#define UNICODE_LINE_SEPA_0 0xE2 -#define UNICODE_LINE_SEPA_1 0x80 -#define UNICODE_LINE_SEPA_2 0xA8 -#define UNICODE_PARA_SEPA_0 0xE2 -#define UNICODE_PARA_SEPA_1 0x80 -#define UNICODE_PARA_SEPA_2 0xA9 - #endif /* Include guard */ + -- 2.7.4