[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fpurge.c, freadahead.c, freading.c make wrong assumption
From: |
Bruno Haible |
Subject: |
Re: fpurge.c, freadahead.c, freading.c make wrong assumption |
Date: |
Fri, 14 Mar 2008 01:32:10 +0100 |
User-agent: |
KMail/1.5.4 |
Hi,
Roger Cornelius wrote:
> > When _IOERR is defined, fpurge.c, freadahead.c, and freading.c wrongly
> > assume FILE struct members are named with a single leading "_"
> > character. E.g., this section of code at line 95 of fpurge.c:
> >
> > # elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris,
> > mingw */
> > fp->_ptr = fp->_base;
> > if (fp->_ptr != NULL)
> > fp->_cnt = 0;
> > return 0;
> > # elif defined __UCLIBC__ /* uClibc */
> >
> >
> > In the case of SCO OpenServer and Unixware, this assumption is wrong.
> > On these OS'es, FILE struct members are named using two leading "_"
> > characters.
1) On HP-UX the fields also are called __base etc. but there are
#define _base __base
definitions which make it work nevertheless. Can you look whether the
stdio.h on your system has a similar thing, and if so, what needs to be
done to trigger the single-underscore names?
2) Can you provide a compile-time check for this platform? (The info on
http://predef.sourceforge.net/ does not appear to be complete in this case.)
What's the result of
$ touch empty.c
$ gcc -E -dM empty.c | sort
Bruno