From 648a0536247d8054d4a6632538ce0ebf4ff8d3ca Mon Sep 17 00:00:00 2001 From: Mat Boehlke Date: Tue, 13 Sep 2022 21:37:55 -0500 Subject: [PATCH] id3lib: patch for c99 bool id3/globals.h has a typedef for bool which is incompatible with c99 stdbool. This is a known issue, but upstream is effectively unmaintained. See https://sourceforege.net/p/id3lib/mailman/message/30500558/ --- srcpkgs/id3lib/patches/c99-bool.patch | 23 +++++++++++++++++++++++ srcpkgs/id3lib/patches/test-io.patch | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 srcpkgs/id3lib/patches/c99-bool.patch create mode 100644 srcpkgs/id3lib/patches/test-io.patch diff --git a/srcpkgs/id3lib/patches/c99-bool.patch b/srcpkgs/id3lib/patches/c99-bool.patch new file mode 100644 index 000000000000..bc8996419bab --- /dev/null +++ b/srcpkgs/id3lib/patches/c99-bool.patch @@ -0,0 +1,23 @@ +Needed for C99 bool compatability when stdbool.h is included: +https://sourceforge.net/p/id3lib/mailman/message/30500558/ + +diff --git a/include/id3/globals.h b/include/id3/globals.h +index 5d8fa20..733ab3f 100644 +--- a/include/id3/globals.h ++++ b/include/id3/globals.h +@@ -82,13 +82,13 @@ + + #define ID3_C_VAR extern + +-#ifndef __cplusplus ++#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined) + + typedef int bool; + # define false (0) + # define true (!false) + +-#endif /* __cplusplus */ ++#endif /* __cplusplus __bool_true_false_are_defined */ + + ID3_C_VAR const char * const ID3LIB_NAME; + ID3_C_VAR const char * const ID3LIB_RELEASE; diff --git a/srcpkgs/id3lib/patches/test-io.patch b/srcpkgs/id3lib/patches/test-io.patch new file mode 100644 index 000000000000..7b18b4a9e0fa --- /dev/null +++ b/srcpkgs/id3lib/patches/test-io.patch @@ -0,0 +1,22 @@ +diff --git a/examples/test_io.cpp b/examples/test_io.cpp +index bee1a27..80020eb 100644 +--- a/examples/test_io.cpp ++++ b/examples/test_io.cpp +@@ -24,7 +24,7 @@ main(size_t argc, const char** argv) + ID3D_INIT_WARNING(); + ID3D_INIT_NOTICE(); + +- ID3_IStreamReader isr(cin); ++ ID3_IStreamReader isr(std::cin); + BString orig = io::readAllBinary(isr); + + cout << "input size: " << orig.size() << endl; +@@ -116,7 +116,7 @@ main(size_t argc, const char** argv) + cout << "binary number:"; + for (size_t i = 0; i < number.size(); ++i) + { +- cout << " 0x" << hex << (size_t) (0xFF & number[i]) << dec; ++ cout << " 0x" << std::hex << (size_t) (0xFF & number[i]) << std::dec; + } + cout << endl; +