Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-09-26 11:16:12


> I've discovered a bug of Borland's compiler (version 5.6.4 for Win32)
> standard library implementation - the errno is not a macro (as it should
> be
> according to The Standard - 17.4.1.2. p. 5), furthermore it's only in the
> std namespace (17.4.1.2. p. 4). Because of the second problem I'd suggest
> to
> add using std::errno line to the boost/config/compiler/borland.hpp file to
> make errno global as it should be, or maybe a macro BOOST_ERRNO which
> would
> evaluate to std::errno for Borland and just errno for other
> implementations.
> Am I right and how to do this/who's responsible for that?

You're almost right: the actual error you get depends on which run time
library option you select, if you build with -tWM it actually complains
about __errno not errno.

I think the obvious fix is to just include <errno.h> and #define the symbol
if it's not already like this:

Index: boost/config/compiler/borland.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/config/compiler/borland.hpp,v
retrieving revision 1.34
diff -r1.34 borland.hpp
59a60,64
> // fix broken errno declaration:
> # include <errno.h>
> # ifndef errno
> # define errno errno
> # endif

If no-one objects that's what I propose to commit to cvs.

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk