From: bernie Date: Fri, 10 Feb 2006 12:36:57 +0000 (+0000) Subject: Pacify IAR warnings for side-effects. X-Git-Tag: 1.0.0~735 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=ff16c7e3fd2184d58a87d5fe1576cd246ecb719e;p=bertos.git Pacify IAR warnings for side-effects. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@506 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/cfg/macros.h b/cfg/macros.h index 5d363173..ded2261b 100755 --- a/cfg/macros.h +++ b/cfg/macros.h @@ -14,6 +14,9 @@ /*#* *#* $Log$ + *#* Revision 1.6 2006/02/10 12:36:57 bernie + *#* Pacify IAR warnings for side-effects. + *#* *#* Revision 1.5 2005/11/04 16:20:01 bernie *#* Fix reference to README.devlib in header. *#* @@ -137,7 +140,13 @@ } while (0) #else /* !COMPILER_TYPEOF */ /* Sub-optimal implementation that only works with integral types. */ - #define SWAP(a, b) ((a) ^= (b) ^= (a) ^= (b)) + #define SWAP(a, b) \ + do { \ + (a) ^= (b); \ + (b) ^= (a); \ + (a) ^= (b); \ + } while (0) + #endif /* COMPILER_TYPEOF */ #ifndef BV