[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: isnan() and isinf() checks
From: Alexander Neundorf <neundorf () kde ! org>
Date: 2007-04-12 17:26:06
Message-ID: 200704121926.07139.neundorf () kde ! org
[Download RAW message or body]
On Thursday 12 April 2007 01:31, Hasso Tepper wrote:
> The C99 standard says that isinf and isnan are macros, but reality is
> more complex. These might be functions in some systems (glibc has even
> both!) and might require -lm. At the moment we only check whether
> function exists and in the trunk we don't use -lm for check either.
>
> Attached are patches to fix the problem for both KDE3 and KDE4. As a
> side effect it also fixes detecting (_)finite in KDE4 for platforms
> where it requires -lm.
Using "-lm" is no good idea, as Christian already stated.
Please take a look at kdelibs/cmake/modules/MacroPushRequiredVars.cmake, it
offers two macros:
# Usage:
# MACRO_PUSH_REQUIRED_VARS()
# SET(CMAKE_REQUIRED_DEFINITIONS
${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
# CHECK_FUNCTION_EXISTS(...)
# MACRO_POP_REQUIRED_VARS()
> Patches are tested on Linux and DragonFlyBSD. If noone objects, I will
> commit tomorrow.
Can you please check whether check_symbol_exists() (from
Modules/CheckSymbolExists.cmake) does what you need instead of using
check_c_source_compiles() directly ?
Bye
Alex
--
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org - http://www.kde.org
alex AT neundorf.net - http://www.neundorf.net
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic