guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: desmume: fix build on new GCC versions


From: guix-commits
Subject: branch master updated: gnu: desmume: fix build on new GCC versions
Date: Sun, 23 Feb 2020 12:40:42 -0500

This is an automated email from the git hooks/post-receive script.

niedzejkob pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new f267420  gnu: desmume: fix build on new GCC versions
f267420 is described below

commit f267420707142dc17f8e9f976f98447697823c85
Author: raingloom <address@hidden>
AuthorDate: Wed Feb 19 14:36:26 2020 +0100

    gnu: desmume: fix build on new GCC versions
    
    * gnu/packages/emulation.scm (desmume): add patches
    * gnu/packages/patches/desmume-gcc6-fixes.patch: new file
    * gnu/packages/patches/desmume-gcc7-fixes.patch: new file
    * gnu/local.mk (dist_patch_DATA): register the above
    
    Note: desmume-gcc6-fixes.patch contains some CRLF line endings.
    
    Signed-off-by: Jakub Kądziołka <address@hidden>
---
 gnu/local.mk                                  |  2 +
 gnu/packages/emulators.scm                    |  4 +-
 gnu/packages/patches/desmume-gcc6-fixes.patch | 59 +++++++++++++++++++++++++++
 gnu/packages/patches/desmume-gcc7-fixes.patch | 18 ++++++++
 4 files changed, 82 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index c26ea40..94b07c9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -809,6 +809,8 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/debops-constants-for-external-program-names.patch \
   %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \
   %D%/packages/patches/deja-dup-use-ref-keyword-for-iter.patch \
+  %D%/packages/patches/desmume-gcc6-fixes.patch                        \
+  %D%/packages/patches/desmume-gcc7-fixes.patch                        \
   %D%/packages/patches/dfu-programmer-fix-libusb.patch         \
   %D%/packages/patches/diffutils-gets-undeclared.patch         \
   %D%/packages/patches/dkimproxy-add-ipv6-support.patch                \
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 92e50d1..5e1ab6c 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -102,7 +102,9 @@
              version "/desmume-" version ".tar.gz"))
        (sha256
         (base32
-         "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))))
+         "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))
+       (patches (search-patches "desmume-gcc6-fixes.patch"
+                                "desmume-gcc7-fixes.patch"))))
     (build-system gnu-build-system)
     (arguments
      ;; Enable support for WiFi and microphone.
diff --git a/gnu/packages/patches/desmume-gcc6-fixes.patch 
b/gnu/packages/patches/desmume-gcc6-fixes.patch
new file mode 100644
index 0000000..6eb9576
--- /dev/null
+++ b/gnu/packages/patches/desmume-gcc6-fixes.patch
@@ -0,0 +1,59 @@
+From: zeromus
+Origin: upstream, https://sourceforge.net/p/desmume/code/5514, 
https://sourceforge.net/p/desmume/code/5517, 
https://sourceforge.net/p/desmume/code/5430
+Subject: fix GCC6 issues
+Bug: https://sourceforge.net/p/desmume/bugs/1570/
+Bug-Debian: http://bugs.debian.org/811691
+
+Index: desmume/src/MMU_timing.h
+===================================================================
+--- desmume/src/MMU_timing.h   (revision 5513)
++++ desmume/src/MMU_timing.h   (revision 5517)
+@@ -155,8 +155,8 @@
+       enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT };
+       enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT };
+       enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT };
+-      enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
+-      enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << 
BLOCKSIZESHIFT) };
++      enum { TAGMASK = (u32)(~0U << TAGSHIFT) };
++      enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << 
BLOCKSIZESHIFT) };
+       enum { WORDSIZE = sizeof(u32) };
+       enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE };
+       enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY };
+Index: desmume/src/ctrlssdl.cpp
+===================================================================
+--- desmume/src/ctrlssdl.cpp   (revision 5513)
++++ desmume/src/ctrlssdl.cpp   (revision 5517)
+@@ -200,7 +200,7 @@
+           break;
+         case SDL_JOYAXISMOTION:
+           /* Dead zone of 50% */
+-          if( (abs(event.jaxis.value) >> 14) != 0 )
++          if( ((u32)abs(event.jaxis.value) >> 14) != 0 )
+             {
+               key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | 
((event.jaxis.axis & 127) << 1);
+               if (event.jaxis.value > 0) {
+@@ -370,7 +370,7 @@
+          Note: button constants have a 1bit offset. */
+     case SDL_JOYAXISMOTION:
+       key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | 
((event->jaxis.axis & 127) << 1);
+-      if( (abs(event->jaxis.value) >> 14) != 0 )
++      if( ((u32)abs(event->jaxis.value) >> 14) != 0 )
+         {
+           if (event->jaxis.value > 0)
+             key_code |= 1;
+Index: desmume/src/wifi.cpp
+===================================================================
+--- desmume/src/wifi.cpp       (revision 5429)
++++ desmume/src/wifi.cpp       (revision 5430)
+@@ -320,9 +320,9 @@
+ 
+ #if (WIFI_LOGGING_LEVEL >= 1)
+       #if WIFI_LOG_USE_LOGC
+-              #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) 
LOGC(8, "WIFI: "__VA_ARGS__);
++              #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) 
LOGC(8, "WIFI: " __VA_ARGS__);
+       #else
+-              #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) 
printf("WIFI: "__VA_ARGS__);
++              #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) 
printf("WIFI: " __VA_ARGS__);
+       #endif
+ #else
+ #define WIFI_LOG(level, ...) {}
diff --git a/gnu/packages/patches/desmume-gcc7-fixes.patch 
b/gnu/packages/patches/desmume-gcc7-fixes.patch
new file mode 100644
index 0000000..a4934ff
--- /dev/null
+++ b/gnu/packages/patches/desmume-gcc7-fixes.patch
@@ -0,0 +1,18 @@
+From e1f7039f1b06add4fb75b2f8774000b8f05574af Mon Sep 17 00:00:00 2001
+From: rogerman <address@hidden>
+Date: Mon, 17 Aug 2015 21:15:04 +0000
+Subject: Fix bug with libfat string handling.
+
+diff --git a/src/utils/libfat/directory.cpp b/src/utils/libfat/directory.cpp
+index 765d7ae5..b6d7f01f 100644
+--- a/src/utils/libfat/directory.cpp
++++ b/src/utils/libfat/directory.cpp
+@@ -139,7 +139,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const 
char* src, size_t len
+       int bytes;
+       size_t count = 0;
+ 
+-      while (count < len-1 && src != '\0') {
++      while (count < len-1 && *src != '\0') {
+               bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps);
+               if (bytes > 0) {
+                       *dst = (ucs2_t)tempChar;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]