From: Greg C. <chi...@mi...> - 2003-01-29 12:48:21
|
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); Google seems to find only one or two unique hits for '_STLP_HAS_NATIVE_FLOAT_ABS', and I can't reach the URLs directly, but google's cache has: http://www.mit.edu/afs/sipb/project/stlport/295/cstd/cstdlib // boris : if we do not have native float abs, we define ours; then we cannot do "using" for "other" abs # ifdef _STLP_HAS_NATIVE_FLOAT_ABS using _STLP_VENDOR_CSTD::abs; # endif # ifdef _STLP_IMPORT_VENDOR_CSTD _STLP_BEGIN_NAMESPACE # if ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS) # ifdef _STLP_HAS_NATIVE_FLOAT_ABS using _STLP_VENDOR_CSTD::abs; # endif So maybe that wasn't such a WAG. The msvc rtl doesn't have this, so _STLP_HAS_NATIVE_FLOAT_ABS could be defined based on __MINGW32__ as well as the gcc version. Or maybe it's easy enough to fix it here...I don't think I've got the very latest version, but in include/math.h I see float fabsf(float); but not float fabs(float); so the former could be cloned, removing the '-f': extern __inline__ float fabs (float x) { float res; __asm__ ("fabs;" : "=t" (res) : "0" (x)); return res; } although I don't have stlport to test that idea. |