commit 440eb34cfbe667996fa9657923c713adf0a7ba5d
Author: Mamoru TASAKA <mtasaka(a)fedoraproject.org>
Date: Thu Jan 30 23:40:50 2025 +0900
Support C23 and C++17
zsnes-1.51-C23-avoid-keyword-bool-usage.patch | 47 +++++++++++
...7-remove-dynamic-exception-specifications.patch | 93 ++++++++++++++++++++++
zsnes.spec | 16 ++--
3 files changed, 151 insertions(+), 5 deletions(-)
---
diff --git a/zsnes-1.51-C23-avoid-keyword-bool-usage.patch
b/zsnes-1.51-C23-avoid-keyword-bool-usage.patch
new file mode 100644
index 0000000..096c089
--- /dev/null
+++ b/zsnes-1.51-C23-avoid-keyword-bool-usage.patch
@@ -0,0 +1,47 @@
+From c4464bdbdcc894617ecad093f76bec9cba9e0c73 Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka(a)fedoraproject.org>
+Date: Thu, 30 Jan 2025 21:05:49 +0900
+Subject: [PATCH] C23: avoid keyword bool usage
+
+---
+ chips/dsp3emu.c | 4 +---
+ chips/obc1emu.c | 1 -
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/chips/dsp3emu.c b/chips/dsp3emu.c
+index 0241f67..dc96486 100644
+--- a/chips/dsp3emu.c
++++ b/chips/dsp3emu.c
+@@ -27,8 +27,6 @@ typedef char int8;
+ typedef short int16;
+ typedef long int32;
+
+-//C++ in C
+-typedef unsigned char bool;
+ #define true 1
+ #define false 0
+
+@@ -377,7 +375,7 @@ void DSP3_Convert()
+ SetDSP3 = &DSP3_Convert_A;
+ }
+
+-bool DSP3_GetBits(uint8 Count)
++bool8 DSP3_GetBits(uint8 Count)
+ {
+ if (!DSP3_BitsLeft)
+ {
+diff --git a/chips/obc1emu.c b/chips/obc1emu.c
+index 96cd7f1..cdbd38e 100644
+--- a/chips/obc1emu.c
++++ b/chips/obc1emu.c
+@@ -28,7 +28,6 @@ typedef short int16;
+ typedef long int32;
+
+ //C++ in C
+-typedef unsigned char bool;
+ #define true 1
+ #define false 0
+
+--
+2.48.1
+
diff --git a/zsnes-1.51-cpp17-remove-dynamic-exception-specifications.patch
b/zsnes-1.51-cpp17-remove-dynamic-exception-specifications.patch
new file mode 100644
index 0000000..00e4181
--- /dev/null
+++ b/zsnes-1.51-cpp17-remove-dynamic-exception-specifications.patch
@@ -0,0 +1,93 @@
+From 2d060c52c86f54a33f7a48c163f324e6a0d09306 Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka(a)fedoraproject.org>
+Date: Thu, 30 Jan 2025 22:15:09 +0900
+Subject: [PATCH] C++17: remove dynamic exception specifications
+
+---
+ jma/jma.cpp | 10 +++++-----
+ jma/jma.h | 10 +++++-----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/jma/jma.cpp b/jma/jma.cpp
+index 87e0322..cf02f66 100644
+--- a/jma/jma.cpp
++++ b/jma/jma.cpp
+@@ -48,7 +48,7 @@ namespace JMA
+
+
+ //Retreive the file block, what else?
+- void jma_open::retrieve_file_block() throw(jma_errors)
++ void jma_open::retrieve_file_block()
+ {
+ unsigned char uint_buffer[UINT_SIZE];
+ unsigned char ushort_buffer[USHORT_SIZE];
+@@ -168,7 +168,7 @@ namespace JMA
+ }
+
+ //Constructor for opening JMA files for reading
+- jma_open::jma_open(const char *compressed_file_name) throw (jma_errors)
++ jma_open::jma_open(const char *compressed_file_name)
+ {
+ decompressed_buffer = 0;
+ compressed_buffer = 0;
+@@ -229,7 +229,7 @@ namespace JMA
+ }
+
+ //Skip forward a given number of chunks
+- void jma_open::chunk_seek(unsigned int chunk_num) throw(jma_errors)
++ void jma_open::chunk_seek(unsigned int chunk_num)
+ {
+ //Check the stream is open
+ if (!stream.is_open())
+@@ -257,7 +257,7 @@ namespace JMA
+
+ //Return a vector of pointers to each file in the JMA, the buffer to hold all the
files
+ //must be initilized outside.
+- vector<unsigned char *> jma_open::get_all_files(unsigned char *buffer)
throw(jma_errors)
++ vector<unsigned char *> jma_open::get_all_files(unsigned char *buffer)
+ {
+ //If there's no stream we can't read from it, so exit
+ if (!stream.is_open())
+@@ -396,7 +396,7 @@ namespace JMA
+ }
+
+ //Extracts the file with a given name found in the archive to the given buffer
+- void jma_open::extract_file(string& name, unsigned char *buffer)
throw(jma_errors)
++ void jma_open::extract_file(string& name, unsigned char *buffer)
+ {
+ if (!stream.is_open())
+ {
+diff --git a/jma/jma.h b/jma/jma.h
+index 2aaa5ca..bec971a 100644
+--- a/jma/jma.h
++++ b/jma/jma.h
+@@ -64,12 +64,12 @@ namespace JMA
+ class jma_open
+ {
+ public:
+- jma_open(const char *) throw(jma_errors);
++ jma_open(const char *);
+ ~jma_open();
+
+ std::vector<jma_public_file_info> get_files_info();
+- std::vector<unsigned char *> get_all_files(unsigned char *)
throw(jma_errors);
+- void extract_file(std::string& name, unsigned char *) throw(jma_errors);
++ std::vector<unsigned char *> get_all_files(unsigned char *);
++ void extract_file(std::string& name, unsigned char *);
+ bool is_solid();
+
+ private:
+@@ -79,8 +79,8 @@ namespace JMA
+ unsigned char *decompressed_buffer;
+ unsigned char *compressed_buffer;
+
+- void chunk_seek(unsigned int) throw(jma_errors);
+- void retrieve_file_block() throw(jma_errors);
++ void chunk_seek(unsigned int);
++ void retrieve_file_block();
+ };
+
+ const char *jma_error_text(jma_errors);
+--
+2.48.1
+
diff --git a/zsnes.spec b/zsnes.spec
index cca1b5d..fd40b29 100644
--- a/zsnes.spec
+++ b/zsnes.spec
@@ -4,7 +4,7 @@
Summary: A Super Nintendo emulator
Name: zsnes
Version: 1.51
-Release: 42%{?dist}
+Release: 43%{?dist}
License: GPLv2
URL:
http://www.zsnes.com/
Source:
http://dl.sf.net/%{name}/%{name}%{pkgversion}src.tar.bz2
@@ -43,6 +43,10 @@ Patch12: zsnes-1.51-FORTIFY_SOURCE_2.patch
Patch13: zsnes-1.51-FORTIFY_SOURCE_3.patch
# Again FORTIFY_SOURCE, for pal16bxcl
Patch14: zsnes-1.51-FORTIFY_SOURCE_4.patch
+# C23: avoid keyword bool usage
+Patch15: zsnes-1.51-C23-avoid-keyword-bool-usage.patch
+# C++17: remove dynamic exception specifications
+Patch16: zsnes-1.51-cpp17-remove-dynamic-exception-specifications.patch
# This is to build only for ix86 on plague
#ExclusiveArch: %{ix86}
@@ -85,6 +89,8 @@ and to save the game state, even network play is possible.
%patch -P12 -p2
%patch -P13 -p2
%patch -P14 -p2
+%patch -P15 -p1
+%patch -P16 -p1
# Remove hardcoded CFLAGS and LDFLAGS
sed -i \
@@ -111,10 +117,6 @@ mv ../docs/readme.txt/support.txt.utf8
../docs/readme.txt/support.txt
sed -i -e 's/^Icon=%{name}.png$/Icon=%{name}/g' \
linux/%{name}.desktop
-# Use -std=gnu++14 for CXX source for now, this is not ready for C++17
-sed -i configure.in \
- -e '\@CXXFLAGS=@s|CFLAGS|CFLAGS -std=gnu++14 |'
-
%build
aclocal
autoconf
@@ -159,6 +161,10 @@ done
%changelog
+* Thu Jan 30 2025 Mamoru TASAKA <mtasaka(a)fedoraproject.org> - 1.51-43
+- Support C23: avoid keyword bool usage
+- Support C++17: remove dynamic exception specifications
+
* Wed Jan 29 2025 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
1.51-42
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild