From 0eb9afc31dc3e2704f590c64e0e71e8bb75b4fd8 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 14 Mar 2025 20:15:56 +0300
Subject: [PATCH] mp3 (mpg123): disable _FILE_OFFSET_BITS suffixes on libmpg123
calls
Avoids libmpg123's terrifying mess. Useful if mpg123_shared is disabled
and if SDL_mixer is built with _FILE_OFFSET_BITS=64.
(backported from commit 72a73339731a12c1002f9caca64f1ab924938102)
---
dynamic_mp3.h | 3 +++
music_mpg.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/dynamic_mp3.h b/dynamic_mp3.h
index 2e4c48af7..4b21484a7 100644
--- a/dynamic_mp3.h
+++ b/dynamic_mp3.h
@@ -21,6 +21,9 @@
#ifdef MP3_MUSIC
+#ifndef MPG123_NO_LARGENAME
+#define MPG123_NO_LARGENAME /* disable the _FILE_OFFSET_BITS suffixes. */
+#endif
#include <mpg123.h>
typedef struct {
diff --git a/music_mpg.h b/music_mpg.h
index d118be805..da5277359 100644
--- a/music_mpg.h
+++ b/music_mpg.h
@@ -21,6 +21,9 @@
#ifdef MP3_MUSIC
+#ifndef MPG123_NO_LARGENAME
+#define MPG123_NO_LARGENAME /* disable the _FILE_OFFSET_BITS suffixes. */
+#endif
#include <mpg123.h>
#include "SDL_rwops.h"
#include "mp3utils.h"