This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid more problems with type clashes


On Thu, Mar 13, 2003 at 11:31:07AM -0500, J. Johnston wrote:
> Ok, I see now.
> 
> I would prefer a cleaner solution that doesn't do this via the 
> _COMPILING_NEWLIB
> flag in stdio.h.  I also would like it to be a generic solution so other 
> platforms can
> use it, if desired/needed.
> 
> What I am thinking of is to add the wrapper functions that take the 
> external type and
> call the correct function underneath.  For example, we change the current 
> fgetpos
> routine to be called _fgetpos() which takes _fpos_t and we also add to 
> fgetpos.c,
> an fgetpos() wrapper routine that takes fpos_t.  The wrapper function calls 
> _fgetpos()
> or fgetpos64 based on a compiler flag.  Prototypes for _fgetpos() etc..
> could be hidden in stdio/local.h.  The wrapper function would be #ifdef'd
> out if the flag isn't set and instead, we redefine _fgetpos to be fgetpos.
> 
> Currently you are using __CYGWIN_USE_BIG_TYPES__, but if this were renamed 
> to
> be something more generic (e.g. __LARGE64_DEFAULTED__), then any platform
> could use it if desired.
> 
> I can implement the patch if you would like.

Hmm, I don't think it's actually necessary to do it that complicated.
The only unclean part is IMHO the usage of __CYGWIN_USE_BIG_TYPES__
in stdio.h which should be changed to a more generic name but otherwise
everything's fine as it is.

There's also a problem with already existing function calls which are
expected in the underlying system API.  E. g. you can't change lseek to
_lseek and open to _open for that reason.

Corinna

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat dot com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]