[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: kdelibs 3.80.3 on OpenBSD - isfinite()
From: Alex Merry <alexander.merry () ccc ! ox ! ac ! uk>
Date: 2007-03-27 10:44:08
Message-ID: 200703271144.18498.alexander.merry () ccc ! ox ! ac ! uk
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
CC kde-devel
On Monday 26 Mar 2007, Pascal S. de Kloe wrote:
> --- kdelibs-3.80.3/kjs/date_object.cpp-old Mon Feb 19 10:56:56 2007
> +++ kdelibs-3.80.3/kjs/date_object.cpp Thu Mar 22 00:32:18 2007
> @@ -65,6 +65,12 @@
> #endif
> #endif
>
> +#if defined(_GLIBCPP_HAVE_FINITE)
> +#define isfinite(x) finite(x)
> +#elif defined(_GLIBCPP_HAVE__FINITE)
> +#define isfinite(x) _finite(x)
> +#endif
> +
> inline int gmtoffset(const tm& t)
> {
> #if PLATFORM(WIN_OS)
Linux, at least, has both isfinite and finite. We don't want to mask
isfinite with finite. So I guess we should wrap this somehow.
I'm guessing "#ifndef isfinite" won't work. Is there a
_GLIBCPP_HAVE_ISFINITE define? I'm not sure where the _GLIBCPP defines
come from...
Assuming CMake tests work as they should, we can just write a CMake test
for isfinite. check_function_exists didn't work for me on Linux
(claimed it didn't exist), so I used check_prototype_exists on math.h.
Patch attached. Can you check that this works?
Alex :-)
["date_object_openbsd.diff" (text/x-diff)]
Index: kdelibs/kjs/CMakeLists.txt
===================================================================
--- kdelibs/kjs/CMakeLists.txt (revision 647075)
+++ kdelibs/kjs/CMakeLists.txt (working copy)
@@ -14,6 +14,7 @@
check_function_exists(finite HAVE_FUNC_FINITE)
check_function_exists(isinf HAVE_FUNC_ISINF)
check_function_exists(isnan HAVE_FUNC_ISNAN)
+check_prototype_exists(isfinite "math.h" HAVE_FUNC_ISFINITE)
Index: kdelibs/kjs/date_object.cpp
===================================================================
--- kdelibs/kjs/date_object.cpp (revision 647075)
+++ kdelibs/kjs/date_object.cpp (working copy)
@@ -64,8 +64,19 @@
#define isfinite(x) _finite(x)
#define strncasecmp(x, y, z) strnicmp(x, y, z)
#endif
-#endif
+#else /* PLATFORM(WIN_OS) */
+#ifndef HAVE_FUNC_ISFINITE
+#ifdef HAVE_FUNC_FINITE
+#define isfinite(x) finite(x)
+#else /* HAVE_FUNC_FINITE */
+#ifdef HAVE_FUNC__FINITE
+#define isfinite(x) _finite(x)
+#endif /* HAVE_FUNC__FINITE */
+#endif /* HAVE_FUNC_FINITE */
+#endif /* HAVE_FUNC_ISFINITE */
+#endif /* PLATFORM(WIN_OS) */
+
inline int gmtoffset(const tm& t)
{
#if PLATFORM(WIN_OS)
Index: kdelibs/kjs/config.h.cmake
===================================================================
--- kdelibs/kjs/config.h.cmake (revision 647075)
+++ kdelibs/kjs/config.h.cmake (working copy)
@@ -30,5 +30,6 @@
#cmakedefine HAVE_MEMCHECK_H 1
#cmakedefine HAVE_FUNC__FINITE 1
#cmakedefine HAVE_FUNC_FINITE 1
+#cmakedefine HAVE_FUNC_ISFINITE 1
#cmakedefine HAVE_FUNC_ISINF 1
#cmakedefine HAVE_FUNC_ISNAN 1
[Attachment #8 (application/pgp-signature)]
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic