octave-maintainers
[Top][All Lists]
Advanced

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

Re: MSVC compilation problem: std::abs<int64_t> does not exist


From: Jaroslav Hajek
Subject: Re: MSVC compilation problem: std::abs<int64_t> does not exist
Date: Thu, 30 Oct 2008 19:27:56 +0100

On Thu, Oct 30, 2008 at 7:18 PM, Michael Goffioul
<address@hidden> wrote:
> The fix I used up to now is to add
>
> namespace std
> {
>  inline __int64 abs (__int64 x)
>  { return (x >= 0 ? x : -x); }
> }
>
> in lo-math.h. This is enough to work around the problem.
> I surrounded this definition with #ifdef that is only active
> for MSVC, so as to not interfere with the other compilers.
> Wouldn't that be enough?
>

Does MSVC also provide version macros? If yes, then this solution is
OK, and I'm all for it.
If not, we'll run into trouble once the feature is implemented in MSVC
(duplicate definition). If MSVC version can be resolved using #ifdef,
then we'll simply add the proper version check at that moment.


> Michael.
>
>
> On Thu, Oct 30, 2008 at 5:59 PM, John W. Eaton <address@hidden> wrote:
>> On 30-Oct-2008, Jaroslav Hajek wrote:
>>
>> | I have just verified that the expression
>> | (x < 0) ? -x : x produces exaclty the same code as std::abs (x) with
>> | g++ at -O3, so I guess we can use that. But, unless anyone objects,
>> | I'll mark it as a FIXME.
>>
>> It's fine with me.
>>
>> Thanks,
>>
>> jwe
>>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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