SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] Re: Problem building CVS version on OS X

From: Jouni K S. <jk...@ik...> - 2005年12月20日 05:38:16
Andrew Straw <str...@as...> writes:
> extern "C" {
> int isnan(double);
> }
>
>>Apparently, the upshot is that isnan is a C99 feature and C++ does not
>>incorporate C99.
>>
> So, does that mean the above should work on most C++ compilers? (Do
> they implement C99 mode when in extern "C" mode?) 
What extern "C" does is it disables the C++ name-mangling so you can
refer to C functions. The presence of isnan is a header/library issue,
and apparently the cmath header file in some systems makes sure to
hide isnan. It seems that C99 defines an isnan _macro_, and the above
is assuming that an isnan _function_ exists in the library. The isnan
manual page on OS X states:
| HISTORY
| 3BSD introduced isinf() and isnan() functions, which accepted double
| arguments; these have been superseded by the macros described above.
I don't know how widespread these functions are. GNU libc and OS X
have them, and all the world's either Linux or a Mac, right? :-)
I think we could use the system's isnan macro in a fairly clean way by
performing the following dance (untested, and I don't have an OS X
10.3 system to test on):
#include <math.h>
template<typename T> int mpl_isnan(T arg) { return isnan(arg); }
#include <cmath>
Is it possible in distutils to do autoconf-style compilation tests at
configuration time? 
-- 
Jouni

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /