SHA256
1
0
forked from pool/audacity
audacity/audacity-1.3.7-endian-fix.patch

54 lines
1.0 KiB
Diff

--- lib-src/libnyquist/xlisp/xlisp.h
+++ lib-src/libnyquist/xlisp/xlisp.h
@@ -147,14 +147,13 @@
/* Linux on Pentium */
#ifdef __linux__
-#ifdef __i386__
-#define LINUX_INTEL
-#endif
-#endif
-
-#ifdef LINUX_INTEL
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define XL_BIG_ENDIAN
+#else
#define XL_LITTLE_ENDIAN
#endif
+#endif
/* default important definitions */
#ifndef NNODES
--- lib-src/libnyquist/sys/switches.h
+++ lib-src/libnyquist/sys/switches.h
@@ -22,12 +22,13 @@
#define READLINE 1
-#if i386
-#define XL_LITTLE_ENDIAN 1
-#elif __i386__
-#define XL_LITTLE_ENDIAN 1
-#else
+#if !defined(XL_BIG_ENDIAN) && !defined(XL_LITTLE_ENDIAN)
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
#define XL_BIG_ENDIAN 1
+#else
+#define XL_LITTLE_ENDIAN 1
+#endif
#endif
#undef USE_RAND
--- lib-src/libnyquist/snd/sndlinux.c
+++ lib-src/libnyquist/snd/sndlinux.c
@@ -1,6 +1,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <unistd.h>
#include "snd.h"
#include "sndfileio.h"