summarylogtreecommitdiffstats
path: root/libgme-vgmplay-cpp-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libgme-vgmplay-cpp-fixes.patch')
-rw-r--r--libgme-vgmplay-cpp-fixes.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/libgme-vgmplay-cpp-fixes.patch b/libgme-vgmplay-cpp-fixes.patch
new file mode 100644
index 000000000000..d0413a925b2d
--- /dev/null
+++ b/libgme-vgmplay-cpp-fixes.patch
@@ -0,0 +1,42 @@
+From 03a70ee4093b12ee0085414ccf119d11dd536f59 Mon Sep 17 00:00:00 2001
+From: John Regan <john@jrjrtech.com>
+Date: Sun, 23 Feb 2020 11:34:20 -0500
+Subject: [PATCH] use regular template for blargg_min/max
+
+---
+ gme/blargg_source.h | 19 +++----------------
+ 1 file changed, 3 insertions(+), 16 deletions(-)
+
+diff --git a/gme/blargg_source.h b/gme/blargg_source.h
+index 0bf02a8..0f0f575 100644
+--- a/gme/blargg_source.h
++++ b/gme/blargg_source.h
+@@ -118,22 +118,9 @@ otherwise continues normally. */
+ return blargg_err_memory;\
+ } while ( 0 )
+
+-/* The usual min/max functions for built-in types.
+-
+-template<typename T> T min( T x, T y ) { return x < y ? x : y; }
+-template<typename T> T max( T x, T y ) { return x > y ? x : y; } */
+-#define BLARGG_DEF_MIN_MAX( type ) \
+- static inline type blargg_min( type x, type y ) { if ( y < x ) x = y; return x; }\
+- static inline type blargg_max( type x, type y ) { if ( x < y ) x = y; return x; }
+-
+-BLARGG_DEF_MIN_MAX( int )
+-BLARGG_DEF_MIN_MAX( unsigned )
+-BLARGG_DEF_MIN_MAX( long )
+-BLARGG_DEF_MIN_MAX( unsigned long )
+-BLARGG_DEF_MIN_MAX( BOOST::int64_t )
+-BLARGG_DEF_MIN_MAX( BOOST::uint64_t )
+-BLARGG_DEF_MIN_MAX( float )
+-BLARGG_DEF_MIN_MAX( double )
++template<typename T> T blargg_min( T x, T y ) { if ( y < x ) x = y; return x; }
++template<typename T> T blargg_max( T x, T y ) { if ( x < y ) x = y; return x; }
++
+
+ #undef min
+ #define min blargg_min
+--
+2.10.5
+