Re: C++: Math function round() does not compile - why? - resolution
On Tue, 2006-02-14 at 15:15 +0100, Jan C. Nordholz wrote:
> > with g++-2.95, this gives no prototypes for round().
> > So it appears that -std=c99 does not work. Is there some way to achieve
> > this for 2.95? (This is now academic, since I have written my own
> > version for this application.)
> you could use the "features" header. Start your source files with
> #define _ISOC99_SOURCE
> #include <features.h>
> This will toggle the appropriate __USE_* macros (__USE_ISOC99, in this
> case) that aren't set by the compiler. There are a few other macros you
> might want to set (_POSIX_SOURCE, or even _GNU_SOURCE), so perhaps you
> should have a closer look at <features.h> if you plan to use it directly.
Thanks to you and others for that suggestion.
Defining _GNU_SOURCE fixes the problem for g++-2.95.
Oliver Elphick email@example.com
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
Do you want to know God? http://www.lfix.co.uk/knowing_god.html