From e29d83550eb33be51fd9a92d6443633c812504f7 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 31 Jan 2001 20:11:48 +0000 Subject: [PATCH] 2001-01-31 Jeff Johnston * libc/include/stdio.h (FILENAME_MAX): Changed to use __FILENAME_MAX__ if defined. (FOPEN_MAX): Changed to use __FOPEN_MAX__ if defined. (L_tmpnam): Changed to use __L_tmpnam__ if defined. * libc/include/sys/config.h: Changed to set __FILENAME_MAX__ appropriately for Cygwin and RTEMS so not to exceed PATH_MAX. --- newlib/ChangeLog | 9 +++++++++ newlib/libc/include/stdio.h | 21 ++++++++++++++++++--- newlib/libc/include/sys/config.h | 5 +++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 3f29becdb..741fd7b8b 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,12 @@ +2001-01-31 Jeff Johnston + + * libc/include/stdio.h (FILENAME_MAX): Changed to use __FILENAME_MAX__ + if defined. + (FOPEN_MAX): Changed to use __FOPEN_MAX__ if defined. + (L_tmpnam): Changed to use __L_tmpnam__ if defined. + * libc/include/sys/config.h: Changed to set __FILENAME_MAX__ + appropriately for Cygwin and RTEMS so not to exceed PATH_MAX. + Mon Jan 29 23:03:06 2001 Christopher Faylor * libc/stdlib/mallocr.c: Undefine windows preprocessor variables when diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 5d794bd55..9c1a06f76 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -90,9 +90,24 @@ typedef struct __sFILE FILE; #define BUFSIZ 1024 #define EOF (-1) -#define FOPEN_MAX 20 /* must be <= OPEN_MAX */ -#define FILENAME_MAX 1024 /* must be <= PATH_MAX */ -#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ +#ifdef __FOPEN_MAX__ +#define FOPEN_MAX __FOPEN_MAX__ +#else +#define FOPEN_MAX 20 +#endif + +#ifdef __FILENAME_MAX__ +#define FILENAME_MAX __FILENAME_MAX__ +#else +#define FILENAME_MAX 1024 +#endif + +#ifdef __L_tmpnam__ +#define L_tmpnam __L_tmpnam__ +#else +#define L_tmpnam FILENAME_MAX +#endif + #ifndef __STRICT_ANSI__ #define P_tmpdir "/tmp" #endif diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index f8bd8cdb9..0cf4b1e57 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -127,6 +127,7 @@ typedef unsigned int __uint32_t; #if defined(__CYGWIN32__) || defined(__CYGWIN__) +#define __FILENAME_MAX__ (260 - 1 /* NUL */) #if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) #define __IMPORT #else @@ -134,6 +135,10 @@ typedef unsigned int __uint32_t; #endif #endif +#if defined(__rtems__) +#define __FILENAME_MAX__ 255 +#endif + #ifndef __IMPORT #define __IMPORT #endif