[Numpy-discussion] Core math library in numpy

David Cournapeau cournape at gmail.com
Tue Feb 24 12:37:31 EST 2009


On Wed, Feb 25, 2009 at 2:21 AM, Charles R Harris
<charlesr.harris at gmail.com> wrote:
>
> In order to inline, the function definition would need to be in the header
> and a library version would still be required for passing functions by
> address or in case the compiler decided *not* to inline.

I looked more into this while solving some nasty mingw FPU handling
bugs on windows 64. I learnt one thing I did not know about C: you can
define inline static functions in headers, and that's the approach
follows for very short functions. For example, FPU status flag code in
BSD is defined as follows:

fenv.h:

static __inline int feraiseexcept(int __excepts);
...

fenv.c:
int fereaiseexcept(int excepts);

we could follow this, maybe - once we solve the inline problem (many
compilers do not support it for C). Having optional, non inline is
important IMHO, for future SSE or other dynamically loaded
implementations (where inline is not an option).

David



More information about the NumPy-Discussion mailing list