From 15d890bcd3de34c7e2cd53a8b5c78e02d6f8c35d Mon Sep 17 00:00:00 2001 From: yabause Date: Tue, 26 Dec 2006 21:07:39 +0000 Subject: [PATCH] Commited Cyrille Bagard patch to SWAP macro --- desmume/src/armcpu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/desmume/src/armcpu.c b/desmume/src/armcpu.c index 764b6ca7b..41d4d52f9 100644 --- a/desmume/src/armcpu.c +++ b/desmume/src/armcpu.c @@ -29,9 +29,13 @@ armcpu_t NDS_ARM7; armcpu_t NDS_ARM9; -#define SWAP(a, b, c) c=a;\ - a=b;\ - b=c; +#define SWAP(a, b, c) do \ + { \ + c=a; \ + a=b; \ + b=c; \ + } \ + while(0) int armcpu_new(armcpu_t *armcpu, u32 id) {