This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: _GLIBCXX_USE_C99 not working?
Václav Haisman wrote:
>> ...
>>
> Look into the cstdlib header. You will find that llabs(long long) and
> abs(long long) are in the __gnu_cxx namespace there. It is because
long
> long is not C++ standard type.
>
Yes - but abs() and llabs() is also included into std namespace a few
lines later.
The problem is that ::strtold() is also included, but does not exist in
Cygwin's stdlib.h:
cstdlib:
...
#include "stdlib.h"
...
#if _GLIBCXX_USE_C99
namespace __gnu_cxx
{
...
inline long long
llabs(long long __x) { return __x >= 0 ? __x : -__x; }
...
using ::strtold;
}
namespace std
{
...
using __gnu_cxx::llabs;
...
using __gnu_cxx::strtold;
}
#endif
The llabs() in my testcase was only intended as a real-world (found
in ddrescue) usage example.
The problem occurs also if cstdlib is simply included, but not used:
#define _GLIBCXX_USE_C99 1
#include <cstdlib>
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdlib:181:
error: `::strtold' has not been declared
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdlib:200:
error: `__gnu_cxx::strtold' has not been declared
This can be fixed by adding some dummy declaration of strtold:
#define _GLIBCXX_USE_C99 1
void strtold();
#include <cstdlib>
Christian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/