On 22/12/2010, at 6:09 PM, john skaller wrote: > I've been fiddling around with the library moving dependencies out to *.fpc > files. > Now I get this on previously working tests: > > + build/release/bin/flx --static --output_dir=build/release/tut/tutorial > -Ibuild/release/tut/tutorial --test=build/release -c --test=build/release > build/release/tut/tutorial/tut-03.02-1.flx > build/release/tut/tutorial/tut-03.02-1.cpp: In function ‘void > flxusr::tut__hyphen_03__period_02__hyphen_1::_init_(flxusr::tut__hyphen_03__period_02__hyphen_1::thread_frame_t*)’: > build/release/tut/tutorial/tut-03.02-1.cpp:149: error: ‘isnan’ was not > declared in this scope > > > The thing that puzzles me is, "isnan" is defined in math.h, and math.h is > #included. I checked with a 5 line > test.c and test.cpp program, and #include <math.h> includes it, it works in > both cases. So what gives? > Any ideas? Several tests fail because of this. This is why I love C, it's so > reliable ..:)
Well here's the rub: there's a bug in fbuild! (or buildsystem for Felix). On OSX with gcc 4.1.something: This unit compiles as C: #include <math.h> int xxx(double x) { return isnan( x ); } But it does NOT compile as C++. This does: #include <cmath> int xxx(double x) { return ::std::isnan( x ); } I think this is probably bug in the library, but the point is that fbuild gets this wrong. This interscript code using fbuild's config translated to interscript format should choose the correct way: @def gen_nan(t): if config.TARGET_CXX.options.HAVE_CXX_ISNAN_IN_CMATH: tangle(' fun isnan: '+t+' -> bool = "::std::isnan($1)" is postfix requires cmath;') elif config.TARGET_CXX.options.HAVE_C99_ISNAN_IN_MATH: tangle(' fun isnan: '+t+' -> bool = "isnan($1)" is postfix requires math_h;') elif config.TARGET_CXX.options.HAVE_BSD_ISNAN_IN_MATH: tangle(' fun isnan: '+t+' -> bool = "isnan'+fc[t]+'($1)" is postfix requires math_h;') elif config.TARGET_CXX.options.HAVE_BSD_ISNAN_IN_IEEEFP: tangle(' fun isnan: '+t+' -> bool = "isnanf'+fc[t]+'($1)" is postfix requires ieeefp_h;') else: tangle(' fun isnan: '+t+' -> bool = "!($1==$1)" is unary;') but what I get is: open module Float { fun _ctor_float: string -> float = "static_cast<float>(::std::atof($1.data()))" requires cstdlib; fun _ctor_float[T:reals]: T -> float = "static_cast<float>($1)"; fun isnan: float -> bool = "isnan($1)" is postfix requires math_h; fun isinf: float -> bool = "isinf($1)" is postfix requires math_h; fun isfinite: float -> bool = "isfinite($1)" is postfix requires math_h; proc fprint: ostream * float = "*$1<<$2;" requires iostream; } -- john skaller skal...@users.sourceforge.net ------------------------------------------------------------------------------ Forrester recently released a report on the Return on Investment (ROI) of Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even within 7 months. Over 3 million businesses have gone Google with Google Apps: an online email calendar, and document program that's accessible from your browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language