[patch] fix build on FreeBSD

View: New views
2 Messages — Rating Filter:   Alert me  

[patch] fix build on FreeBSD

by gahr@ymail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

the following patch fixes the build on FreeBSD. It would be good if it were imported in the official repository.

The patch is also available here:
http://people.freebsd.org/~gahr/io.diff


--- libs/iovm/source/IoNumber.c.orig 2009-07-30 16:24:17.000000000 +0200
+++ libs/iovm/source/IoNumber.c 2009-07-30 16:26:23.000000000 +0200
@@ -37,6 +37,10 @@
 #define isnan _isnan
 #endif
 
+#ifdef __FreeBSD__
+#define log2(x) (log(x) / M_LN2)
+#endif
+
 #define DATA(self) CNUMBER(self)
 
 IoNumber *IoNumber_numberForDouble_canUse_(IoNumber *self, double n, IoNumber *other)
--- libs/basekit/source/PortableStdint.h.orig 2009-07-31 09:56:02.000000000 +0200
+++ libs/basekit/source/PortableStdint.h 2009-07-31 10:00:19.000000000 +0200
@@ -190,7 +190,7 @@
  *  do nothing else.  On the Mac OS X version of gcc this is _STDINT_H_.
  */
 
-#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED)
+#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED) || defined(__FreeBSD__)
 #include <stdint.h>
 #define _PSTDINT_H_INCLUDED
 # ifndef PRINTF_INT64_MODIFIER



Re: [patch] fix build on FreeBSD

by Steve Dekorte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks I've applied it and pushed it to the repo.

On 2009-07-31, at 1:01 AM, gahr@... wrote:

> Hi all,
>
> the following patch fixes the build on FreeBSD. It would be good if  
> it were imported in the official repository.
>
> The patch is also available here:
> http://people.freebsd.org/~gahr/io.diff
>
>
> --- libs/iovm/source/IoNumber.c.orig 2009-07-30 16:24:17.000000000  
> +0200
> +++ libs/iovm/source/IoNumber.c 2009-07-30 16:26:23.000000000 +0200
> @@ -37,6 +37,10 @@
> #define isnan _isnan
> #endif
>
> +#ifdef __FreeBSD__
> +#define log2(x) (log(x) / M_LN2)
> +#endif
> +
> #define DATA(self) CNUMBER(self)
>
> IoNumber *IoNumber_numberForDouble_canUse_(IoNumber *self, double n,  
> IoNumber *other)
> --- libs/basekit/source/PortableStdint.h.orig 2009-07-31  
> 09:56:02.000000000 +0200
> +++ libs/basekit/source/PortableStdint.h 2009-07-31  
> 10:00:19.000000000 +0200
> @@ -190,7 +190,7 @@
>  *  do nothing else.  On the Mac OS X version of gcc this is  
> _STDINT_H_.
>  */
>
> -#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L)  
> || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) ||  
> __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H)  
> || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED)
> +#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L)  
> || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) ||  
> __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H)  
> || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED) ||  
> defined(__FreeBSD__)
> #include <stdint.h>
> #define _PSTDINT_H_INCLUDED
> # ifndef PRINTF_INT64_MODIFIER
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>