Skip to content

Commit

Permalink
external libs, libvorbisidec: use autoconf WORDS_BIGENDIAN checks,
Browse files Browse the repository at this point in the history
because BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN are not very portable.
As for the previous Android patch: no issues, because Android is always
little-endian:  https://developer.android.com/ndk/guides/abis

Regenerated autofoo files.
  • Loading branch information
sezero committed Dec 1, 2019
1 parent 820bb5e commit 4b814c0
Show file tree
Hide file tree
Showing 30 changed files with 9,789 additions and 6,380 deletions.
11 changes: 0 additions & 11 deletions external/libvorbisidec-1.2.1.patch
Expand Up @@ -34,14 +34,3 @@ diff -u /dev/null libvorbisidec-1.2.1/Android.mk
+LOCAL_SHARED_LIBRARIES := ogg
+
+include $(BUILD_STATIC_LIBRARY)
diff -u libvorbisidec-1.2.1/misc.h~ libvorbisidec-1.2.1/misc.h
--- libvorbisidec-1.2.1/misc.h~
+++ libvorbisidec-1.2.1/misc.h
@@ -30,6 +30,7 @@

#include "asm_arm.h"
#include <stdlib.h> /* for abs() */
+#include <endian.h>

#ifndef _V_WIDE_MATH
#define _V_WIDE_MATH
Expand Up @@ -16,7 +16,7 @@ index 12ba684..69dc200 100644
********************************************************************/

+#ifdef HAVE_CONFIG_H
+#include "config.h"
+# include "config.h"
+#endif
+
#include <math.h>
Expand Down
78 changes: 78 additions & 0 deletions external/libvorbisidec-1.2.1/0018-use-AC_C_BIGENDIAN.patch
@@ -0,0 +1,78 @@
From 5d48fcab6d955a2f8b41c460d6cec3b858894ec7 Mon Sep 17 00:00:00 2001
From: sezero <sezero@users.sourceforge.net>
Date: Tue, 20 Mar 2018 11:50:50 +0300
Subject: [PATCH] use autoconf AC_C_BIGENDIAN / WORDS_BIGENDIAN checks

because BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN are
not very portable..
---
configure.in | 3 +++
misc.h | 17 +++++------------
os.h | 2 --
3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/configure.in b/configure.in
index 4e853dc..ade6f21 100644
--- a/configure.in
+++ b/configure.in
@@ -80,6 +80,9 @@ LDFLAGS="$LDFLAGS $ldflags_save"
AC_PROG_LD
AC_PROG_LD_GNU

+# check endianism
+AC_C_BIGENDIAN
+
dnl --------------------------------------------------
dnl Options
dnl --------------------------------------------------
diff --git a/misc.h b/misc.h
index ee5660d..77cb2e2 100644
--- a/misc.h
+++ b/misc.h
@@ -41,25 +41,18 @@
#include <sys/types.h>
#endif

-#if BYTE_ORDER==LITTLE_ENDIAN
-union magic {
- struct {
- ogg_int32_t lo;
- ogg_int32_t hi;
- } halves;
- ogg_int64_t whole;
-};
-#endif
-
-#if BYTE_ORDER==BIG_ENDIAN
union magic {
struct {
+#ifdef WORDS_BIGENDIAN
ogg_int32_t hi;
ogg_int32_t lo;
+#else /* little endian */
+ ogg_int32_t lo;
+ ogg_int32_t hi;
+#endif
} halves;
ogg_int64_t whole;
};
-#endif

STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
union magic magic;
diff --git a/os.h b/os.h
index 31400de..329c5d0 100644
--- a/os.h
+++ b/os.h
@@ -42,8 +42,6 @@

#ifdef _WIN32
# include <malloc.h>
-# define LITTLE_ENDIAN 1
-# define BYTE_ORDER LITTLE_ENDIAN
#endif

#if defined HAVE_ALLOCA
--
1.7.1

19 changes: 19 additions & 0 deletions external/libvorbisidec-1.2.1/CHANGELOG
@@ -0,0 +1,19 @@
*** 20020517: 1.0.2 ***

Playback bugfix to floor1; mode mistakenly used for sizing instead
of blockflag

*** 20020515: 1.0.1 ***

Added complete API documentation to source tarball. No code
changes.

*** 20020412: 1.0.1 ***

Fixed a clipping bug that affected ARM processors; negative
overflows were being properly clipped, but then clobbered to
positive by the positive overflow chec (asm_arm.h:CLIP_TO_15)

*** 20020403: 1.0.0 ***

Initial version

0 comments on commit 4b814c0

Please sign in to comment.