From 412f8a1bc7141a8d46e6dd51c08a1ebbdebf340a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 1 Nov 1994 14:36:55 +0000 Subject: [PATCH] GNU file utilities --- lib/Makefile.in | 2 +- lib/fsusage.c | 18 +++++++++++------- lib/obstack.c | 6 +++--- lib/obstack.h | 10 +++++----- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index 7740eaf7d..cdbfc2b5d 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -61,7 +61,7 @@ all: libfu.a subdir = lib Makefile: ../config.status Makefile.in - cd ..; CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status installdirs: diff --git a/lib/fsusage.c b/lib/fsusage.c index e8c1bfca1..e0aec2a88 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -154,7 +154,7 @@ get_fs_usage (path, disk, fsp) #define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512) #endif -#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix. */ +#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX. */ struct statfs fsd; if (statfs (path, &fsd, sizeof fsd, 0) < 0) @@ -162,12 +162,16 @@ get_fs_usage (path, disk, fsp) /* Empirically, the block counts on most SVR3 and SVR3-derived systems seem to always be in terms of 512-byte blocks, no matter what value f_bsize has. */ -#define CONVERT_BLOCKS(b) (b) -#ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */ -#ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */ -#define f_bavail f_bfree -#endif -#endif +# if _AIX +# define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512) +# else +# define CONVERT_BLOCKS(b) (b) +# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */ +# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */ +# define f_bavail f_bfree +# endif +# endif +# endif #endif #ifdef STAT_STATVFS /* SVR4. */ diff --git a/lib/obstack.c b/lib/obstack.c index a8a450070..bf18ddc87 100644 --- a/lib/obstack.c +++ b/lib/obstack.c @@ -31,7 +31,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) -#ifdef __STDC__ +#if defined (__STDC__) && __STDC__ #define POINTER void * #else #define POINTER char * @@ -267,7 +267,7 @@ _obstack_newchunk (h, length) This is here for debugging. If you use it in a program, you are probably losing. */ -#ifdef __STDC__ +#if defined (__STDC__) && __STDC__ /* Suppress -Wmissing-prototypes warning. We don't want to declare this in obstack.h because it is just for debugging. */ int _obstack_allocated_p (struct obstack *h, POINTER obj); @@ -374,7 +374,7 @@ obstack_free (h, obj) /* Now define the functional versions of the obstack macros. Define them to simply use the corresponding macros to do the job. */ -#ifdef __STDC__ +#if defined (__STDC__) && __STDC__ /* These function definitions do not work with non-ANSI preprocessors; they won't pass through the macro names in parentheses. */ diff --git a/lib/obstack.h b/lib/obstack.h index 01767195d..a5db1a0e7 100644 --- a/lib/obstack.h +++ b/lib/obstack.h @@ -119,7 +119,7 @@ Summary: but in traditional C it is usually long. If we are in ANSI C and don't already have ptrdiff_t get it. */ -#if defined (__STDC__) && ! defined (offsetof) +#if defined (__STDC__) && __STDC__ && ! defined (offsetof) #if defined (__GNUC__) && defined (IN_GCC) /* On Next machine, the system's stddef.h screws up if included after we have defined just ptrdiff_t, so include all of stddef.h. @@ -132,7 +132,7 @@ Summary: #include #endif -#ifdef __STDC__ +#if defined (__STDC__) && __STDC__ #define PTR_INT_TYPE ptrdiff_t #else #define PTR_INT_TYPE long @@ -167,7 +167,7 @@ struct obstack /* control current object in current chunk */ /* Declare the external functions we use; they are in obstack.c. */ -#ifdef __STDC__ +#if defined (__STDC__) && __STDC__ extern void _obstack_newchunk (struct obstack *, int); extern void _obstack_free (struct obstack *, void *); extern int _obstack_begin (struct obstack *, int, int, @@ -181,7 +181,7 @@ extern int _obstack_begin (); extern int _obstack_begin_1 (); #endif -#ifdef __STDC__ +#if defined (__STDC__) && __STDC__ /* Do the function-declarations after the structs but before defining the macros. */ @@ -492,7 +492,7 @@ __extension__ \ (h)->object_base = (h)->next_free, \ __INT_TO_PTR ((h)->temp))) -#ifdef __STDC__ +#if defined (__STDC__) && __STDC__ #define obstack_free(h,obj) \ ( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ -- 2.11.0