bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexpected frexpf implementation used by MSVC9 in C++ mode


From: Michael Goffioul
Subject: Re: Unexpected frexpf implementation used by MSVC9 in C++ mode
Date: Sun, 11 Mar 2012 23:50:20 +0000

On Sun, Mar 11, 2012 at 10:52 PM, Bruno Haible <address@hidden> wrote:
> Michael Goffioul wrote:
>> frexpf is actually defined as a macro in C,
>> and as an inline function in C++.
>
> Normally gnulib avoids collisions with system functions by checking whether
> a system function exists, via AC_CHECK_FUNCS. But AC_CHECK_FUNCS looks
> only in the libraries and misses the inline functions...
>
> Would it help to set REPLACE_FREXPF to 1? To test this, simply change your
> copy of math.in.h, replacing
>
>   # if @REPLACE_FREXPF@
>
> with a)
>
>   # if @REPLACE_FREXPF@ || defined _MSC_VER
>
> or b)
>
>   # if @REPLACE_FREXPF@ || (defined _MSC_VER && defined __cplusplus)
>
> Does one or the other produce better results?

Only a) provides good results, whatever the client code (C or C++).
The version b) does not work as you will use frexpf or rpl_frexpf,
depending on whether you are in C or C++. So you get problems when
mixing both. In my case, gnulib is C, while the client (octave) is
C++: frexpf.c provides frexpf symbol, while C++ expects rpl_frexpf.

I tested on my little sample and it worked fine. Now I suspect frexpf
is not the only occurrence of the issue. AFAIK it can happen with any
xxxf function where gnulib also provide a xxx replacement (most of the
math xxxf functions are inlined in MSVC math.h).

Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]