From: Danny S. <dan...@cl...> - 2003-01-29 20:44:39
|
----- Original Message ----- From: "Greg Chicares" <chi...@mi...> To: <min...@li...> Cc: "Gisle Vanem" <gv...@br...> Sent: Wednesday, 29 January 2003 12:48 Subject: Re: [Mingw-users] Building STLport 4.5 > Danny Smith wrote: > > > > This seems to be the culprit, in stl_gcc.h > > > > # if (__GNUC__ >= 3) > > # define _STLP_HAS_NATIVE_FLOAT_ABS > > # endif > > > > An > > > > #undef _STLP_HAS_NATIVE_FLOAT_ABS > > > > lets complex.cpp compile. > > > > I know about fabs, but what is NATIVE_FLOAT_ABS? > > WAG: maybe it means the compiler (or, actually, > its C standard library) implements > float abs(float); // C++98 26.5/6 > instead of just relying on > double abs(double); > I found it. It's the overloaded abs in cmath in libstdc++ headers. Unlike the C functions, it _is_ initially declared in std and not in global. Hence, the change adding # define _STLP_VENDOR_GLOBAL_CSTD 1 broke _STLP_HAS_NATIVE_FLOAT_ABS I think a better hack than undefining _STLP_HAS_NATIVE_FLOAT_ABS would be this in stlport's cmath # ifdef _STLP_HAS_NATIVE_FLOAT_ABS # ifdef __GNUC__ using std::abs; # else using _STLP_VENDOR_CSTD::abs; # endif # endif but its still pretty ugly. I'll clean up as much as I can and submit a patch to Boris. IMO, the real solution is modifying the mingw runtime headers to do the right thing in C++ so that standard functions are declared in std in the c headers. The main problem I'm running into in doing that are the ginclude'd files like stddef.h and stdarg.h which are installed by GCC and which get included before any mingw version of the headers when building libstdc++. Danny |