Sorry, forgot to attach the patch…

Sébastien Villemot <sebastien.ville...@ens.fr> writes:

> I attach a patch which is applied against the (upcoming) Debian release
> 2.5.5-2 of octave-nan.
>
> It fixes a compilation error on GNU/Hurd (see [1]).
>
> Please consider it for inclusion in the next release of the nan package.
>
> [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670073

Description: Fix FTBFS and enable optimize byte swapping macros on hurd-i386
 The problem is that octave-nan tries to include <machine/endian.h> if BSD is
 defined (which is on Hurd, since it initially wanted to be BSD-compatible,
 somehow). This patch avoids that #include in Hurd, and also enables
 <byteswap.h> on any GNU libc platform (since GNU libc provides that header) to
 have optimized byte swapping macros on GNU/Hurd and also on GNU/kFreeBSD too.
Author: Pino Toscano <p...@debian.org>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670073
Forwarded: no
Last-Update: 2012-04-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/xptopen.cpp
+++ b/src/xptopen.cpp
@@ -72,7 +72,7 @@ SPSS file format
 #define max(a,b)	(((a) > (b)) ? (a) : (b))
 #define min(a,b)	(((a) < (b)) ? (a) : (b))
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
 /* use byteswap macros from the host system, hopefully optimized ones ;-) */
 #include <byteswap.h>
 #endif
@@ -83,7 +83,7 @@ SPSS file format
 #define __BYTE_ORDER __LITTLE_ENDIAN
 #endif
 
-#if (defined(BSD) && (BSD >= 199103))
+#if ((defined(BSD) && !defined(__GNU__)) && (BSD >= 199103))
 #include <machine/endian.h>
 #define __BIG_ENDIAN _BIG_ENDIAN
 #define __LITTLE_ENDIAN _LITTLE_ENDIAN

-- 
Sébastien Villemot
Researcher in Economics & Debian Maintainer
http://www.dynare.org/sebastien
Phone: +33-1-40-77-84-04 - GPG Key: 4096R/381A7594

Attachment: pgpObAUeq3lkk.pgp
Description: PGP signature

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to