mr_bones_    15/05/16 00:05:10

  Added:                crafty-24.1-numcpus.patch
  Log:
  Add patch from Thomas Jürges to compile with numcpus=1 or USE=no-opts (bug 
#542848)
  
  (Portage version: 2.2.18/cvs/Linux x86_64, unsigned Manifest commit)

Revision  Changes    Path
1.1                  games-board/crafty/files/crafty-24.1-numcpus.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-board/crafty/files/crafty-24.1-numcpus.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-board/crafty/files/crafty-24.1-numcpus.patch?rev=1.1&content-type=text/plain

Index: crafty-24.1-numcpus.patch
===================================================================
diff -ru crafty-24.1.org/lock.h crafty-24.1/lock.h
--- crafty-24.1.org/lock.h      2015-03-10 16:24:09.064539177 +0100
+++ crafty-24.1/lock.h  2015-03-10 17:45:37.675995497 +0100
@@ -42,6 +42,7 @@
  *                                                                             
*
  
*******************************************************************************
  */
+#    if defined(__i386__) || defined(__amd64__)
 static void __inline__ LockX86(volatile int *lock) {
   int dummy;
   asm __volatile__(
@@ -71,17 +72,26 @@
       :"memory");
 }
 
-#    define LockInit(p)           (p=0)
-#    define LockFree(p)           (p=0)
-#    define Unlock(p)             (UnlockX86(&p))
-#    define Lock(p)               (LockX86(&p))
-#    define lock_t                volatile int
-#  endif
+#      define LockInit(p)           (p=0)
+#      define LockFree(p)           (p=0)
+#      define Unlock(p)             (UnlockX86(&p))
+#      define Lock(p)               (LockX86(&p))
+#      define lock_t                volatile int
+#    else /* Not building for x86 or amd64 platforms */
+#      define LockInit(p)
+#      define LockFree(p)
+#      define Lock(p)
+#      define Unlock(p)
+#      define Pause()
+#      define lock_t volatile int
+#    endif /* x86 && amd64 platforms or rest of the world. */
+#  endif                          /*  SMP code */
 #else
 #  define LockInit(p)
 #  define LockFree(p)
 #  define Lock(p)
 #  define Unlock(p)
+#  define Pause()
 #  define lock_t volatile int
 #endif                          /*  SMP code */
 /* *INDENT-ON* */




Reply via email to