[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XEN] Wrap compat XLAT_ macros in "do { } while (0)".



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1170335683 0
# Node ID 7b72e2536065ac4181ac9f95d124686ac421f9c5
# Parent  588dd80b56b5411bd9d1860e9e19da39a64e2f5d
[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 <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/tools/get-fields.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -r 588dd80b56b5 -r 7b72e2536065 xen/tools/get-fields.sh
--- a/xen/tools/get-fields.sh   Wed Jan 31 19:37:44 2007 +0000
+++ b/xen/tools/get-fields.sh   Thu Feb 01 13:14:43 2007 +0000
@@ -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 ""
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.