]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
python/swig: Wrap swig-sensitive struct inside #ifwdef SWIG
authorMartin Belanger <martin.belanger@dell.com>
Thu, 27 Apr 2023 14:13:19 +0000 (10:13 -0400)
committerDaniel Wagner <wagi@monom.org>
Thu, 27 Apr 2023 14:24:40 +0000 (16:24 +0200)
To suppress the warnings generated by swig when parsing anonymous
struct/union, we simply wrap the offending struct/union in a
"#ifndef SWIG" statement. This is an acceptable workaround because
we don't need to generate Python bindings for these structs. In
fact, we specifically tell swig to not generate wrappers for all
structs in types.h. Although swig does not generate wrappers for
those structs, it still warns when a struct doesn't have a name
and therefore we need to use this workaround.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
src/nvme/types.h

index 4dfa35de8e7676abc489cea8bb7c5158e237e54a..3bf223710c7555147300d3b60a5f295c32c45601 100644 (file)
@@ -7651,6 +7651,7 @@ enum nvme_io_mgmt_send_mo {
        NVME_IO_MGMT_SEND_RUH_UPDATE = 0x1,
 };
 
+#ifndef SWIG
 /**
  * struct nvme_ns_mgmt_host_sw_specified - Namespace management Host Software
  * Specified Fields.
@@ -7734,5 +7735,6 @@ struct nvme_ns_mgmt_host_sw_specified {
        __le16                  phndl[128];
        __u8                    rsvd768[3328];
 };
+#endif /* SWIG */
 
 #endif /* _LIBNVME_TYPES_H */