Fix build with clang.

This commit is contained in:
Thomas Klausner 2012-03-29 21:28:22 +00:00
parent f348c7ae2b
commit 9dbb6e6c8f
2 changed files with 21 additions and 1 deletions

View file

@ -1,6 +1,7 @@
$NetBSD: distinfo,v 1.1.1.1 2011/11/08 15:48:08 othyro Exp $
$NetBSD: distinfo,v 1.2 2012/03/29 21:28:22 thomasklausner Exp $
SHA1 (fceux-2.1.5.src.tar.bz2) = 599ef6a261ab1bd24e58468886d7cc303e150feb
RMD160 (fceux-2.1.5.src.tar.bz2) = 9852e6f0958d0ec8d926257e78b34579ef10af85
Size (fceux-2.1.5.src.tar.bz2) = 7322199 bytes
SHA1 (patch-SConstruct) = 09fe149eefd00b6d607462ae82f20544ec11bc01
SHA1 (patch-src_utils_endian.h) = b5f1ee41a8cb4e9008154c11ebff8b330557601d

View file

@ -0,0 +1,19 @@
$NetBSD: patch-src_utils_endian.h,v 1.1 2012/03/29 21:28:22 thomasklausner Exp $
Fix build with clang-3.1.
--- src/utils/endian.h.orig 2010-11-07 23:33:11.000000000 +0000
+++ src/utils/endian.h
@@ -99,9 +99,9 @@ int writele(T *Bufo, EMUFILE*os)
CTASSERT(sizeof(T)==1||sizeof(T)==2||sizeof(T)==4||sizeof(T)==8);
switch(sizeof(T)) {
case 1: return write8le((uint8*)Bufo,os);
- case 2: return write16le((uint16*)Bufo,os);
- case 4: return write32le((uint32*)Bufo,os);
- case 8: return write64le((uint64*)Bufo,os);
+ case 2: return write16le(*(uint16*)Bufo,os);
+ case 4: return write32le(*(uint32*)Bufo,os);
+ case 8: return write64le(*(uint64*)Bufo,os);
default:
return 0;
}