From: Tim Deegan Date: Thu, 1 Feb 2007 13:14:43 +0000 (+0000) Subject: [XEN] Wrap compat XLAT_ macros in "do { } while (0)". X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15358^2~28 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9ed702329188d028ff588a5e0f4bd8956b31222d;p=xen.git [XEN] Wrap compat XLAT_ macros in "do { } while (0)". This unbreaks code like if ( !IS_COMPAT(dom) ) memcpy(); else XLAT_foo(); Signed-off-by: Tim Deegan --- diff --git a/xen/tools/get-fields.sh b/xen/tools/get-fields.sh index ccf5675c02..0936bb8fe3 100644 --- a/xen/tools/get-fields.sh +++ b/xen/tools/get-fields.sh @@ -227,7 +227,7 @@ handle_array() { build_body() { echo - echo -n "#define XLAT_$1(_d_, _s_)" + echo -n "#define XLAT_$1(_d_, _s_) do {" local level=1 fields= id= array= arrlvl=1 array_type= type= token for token in $2 do @@ -303,6 +303,8 @@ build_body() { esac test -z "$fields" || fields="$fields $token" done + echo " \\" + echo "} while (0)" echo "" }