]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx: Allow esxVI_X_DynamicCast to be called successfully on X objects
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 18 May 2010 15:37:45 +0000 (17:37 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 19 May 2010 22:00:31 +0000 (00:00 +0200)
This semantic will be used in the ESX storage driver.

src/esx/esx_vi_types.c

index 7d2c02cda92a6eb1e870bc25274d45e9fdb4cd77..de2839f65af17eca6319c2fabfc70c1e8672156b 100644 (file)
 
 
 
+#define ESX_VI__TEMPLATE__DYNAMIC_CAST__ACCEPT(__type)                        \
+    if (((esxVI_Object *)item)->_type == esxVI_Type_##__type) {               \
+        return item;                                                          \
+    }
+
+
+
 #define ESX_VI__TEMPLATE__DYNAMIC_CAST(__type, _accept)                       \
     esxVI_##__type *                                                          \
     esxVI_##__type##_DynamicCast(void *item)                                  \
             return NULL;                                                      \
         }                                                                     \
                                                                               \
+        ESX_VI__TEMPLATE__DYNAMIC_CAST__ACCEPT(__type)                        \
+                                                                              \
         _accept                                                               \
                                                                               \
         return NULL;                                                          \
 
 
 
-#define ESX_VI__TEMPLATE__DYNAMIC_CAST__ACCEPT(__type)                        \
-    if (((esxVI_Object *)item)->_type == esxVI_Type_##__type) {               \
-        return item;                                                          \
-    }
-
-
-
 #define ESX_VI__TEMPLATE__DYNAMIC_SERIALIZE(__type, _dispatch, _serialize)    \
     ESX_VI__TEMPLATE__SERIALIZE_EXTRA(__type,                                 \
       ESX_VI__TEMPLATE__DISPATCH(__type, _dispatch, -1),                      \