[libvirt] [go PATCH 17/37] make the XXX_wrapper.h header files self-contained

Daniel P. Berrangé berrange at redhat.com
Mon Jul 16 13:24:03 UTC 2018


Pull in the main libvirt headers and compat headers from XXX_wrapper.h
so that they are self-contained

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 callbacks_wrapper.go           | 2 --
 connect.go                     | 3 ---
 connect_wrapper.go             | 2 --
 connect_wrapper.h              | 5 +++++
 domain.go                      | 3 ---
 domain_events.go               | 2 --
 domain_events_wrapper.go       | 2 --
 domain_events_wrapper.h        | 4 ++++
 domain_wrapper.go              | 1 -
 domain_wrapper.h               | 3 +++
 events.go                      | 1 -
 events_wrapper.go              | 2 --
 events_wrapper.h               | 3 +++
 lxc.go                         | 3 ---
 lxc_wrapper.go                 | 2 --
 lxc_wrapper.h                  | 4 +++-
 network.go                     | 3 ---
 network_events.go              | 2 --
 network_events_wrapper.go      | 5 +----
 network_events_wrapper.h       | 4 ++++
 network_wrapper.go             | 2 --
 network_wrapper.h              | 4 ++++
 node_device_events.go          | 2 --
 node_device_events_wrapper.go  | 5 +----
 node_device_events_wrapper.h   | 4 ++++
 nwfilter_binding.go            | 3 ---
 nwfilter_binding_wrapper.go    | 2 --
 nwfilter_binding_wrapper.h     | 4 ++++
 qemu.go                        | 4 ----
 qemu_wrapper.go                | 8 ++------
 qemu_wrapper.h                 | 5 +++++
 secret_events.go               | 2 --
 secret_events_wrapper.go       | 5 +----
 secret_events_wrapper.h        | 4 ++++
 storage_pool_events.go         | 2 --
 storage_pool_events_wrapper.go | 3 ---
 storage_pool_events_wrapper.h  | 4 ++++
 storage_volume.go              | 3 ---
 storage_volume_wrapper.go      | 2 --
 storage_volume_wrapper.h       | 4 ++++
 stream.go                      | 3 ---
 stream_wrapper.go              | 2 --
 stream_wrapper.h               | 4 ++++
 43 files changed, 60 insertions(+), 77 deletions(-)

diff --git a/callbacks_wrapper.go b/callbacks_wrapper.go
index 64caf69..9716bb1 100644
--- a/callbacks_wrapper.go
+++ b/callbacks_wrapper.go
@@ -28,8 +28,6 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include "callbacks_wrapper.h"
 
 extern void freeCallbackId(long);
diff --git a/connect.go b/connect.go
index 98ab7ab..639225b 100644
--- a/connect.go
+++ b/connect.go
@@ -36,10 +36,7 @@ import (
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
-#include "connect_compat.h"
 #include "connect_wrapper.h"
 */
 import "C"
diff --git a/connect_wrapper.go b/connect_wrapper.go
index cbafc53..82f0ba7 100644
--- a/connect_wrapper.go
+++ b/connect_wrapper.go
@@ -28,8 +28,6 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <assert.h>
 #include "connect_wrapper.h"
 #include "callbacks_wrapper.h"
diff --git a/connect_wrapper.h b/connect_wrapper.h
index 7af88f1..0fdde02 100644
--- a/connect_wrapper.h
+++ b/connect_wrapper.h
@@ -26,6 +26,11 @@
 
 #ifndef LIBVIRT_GO_CONNECT_WRAPPER_H__
 #define LIBVIRT_GO_CONNECT_WRAPPER_H__
+
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "connect_compat.h"
+
 void closeCallbackHelper(virConnectPtr conn, int reason, void *opaque);
 int virConnectRegisterCloseCallbackHelper(virConnectPtr c, virConnectCloseFunc cb, long goCallbackId);
 
diff --git a/domain.go b/domain.go
index 7253c67..fad2a41 100644
--- a/domain.go
+++ b/domain.go
@@ -28,10 +28,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
-#include "domain_compat.h"
 #include "domain_wrapper.h"
 */
 import "C"
diff --git a/domain_events.go b/domain_events.go
index 5d21b01..68dc301 100644
--- a/domain_events.go
+++ b/domain_events.go
@@ -33,9 +33,7 @@ import (
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
 #include "domain_events_wrapper.h"
-#include "domain_compat.h"
 */
 import "C"
 
diff --git a/domain_events_wrapper.go b/domain_events_wrapper.go
index 799945b..07b9418 100644
--- a/domain_events_wrapper.go
+++ b/domain_events_wrapper.go
@@ -28,8 +28,6 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include "domain_events_wrapper.h"
 #include "callbacks_wrapper.h"
 #include <stdint.h>
diff --git a/domain_events_wrapper.h b/domain_events_wrapper.h
index 55cf48e..a9c98c1 100644
--- a/domain_events_wrapper.h
+++ b/domain_events_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__
 #define LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "domain_compat.h"
+
 void domainEventLifecycleCallbackHelper(virConnectPtr c, virDomainPtr d,
                                      int event, int detail, void* data);
 
diff --git a/domain_wrapper.go b/domain_wrapper.go
index 209af78..1596ae5 100644
--- a/domain_wrapper.go
+++ b/domain_wrapper.go
@@ -28,7 +28,6 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
 #include <assert.h>
 #include "domain_wrapper.h"
 
diff --git a/domain_wrapper.h b/domain_wrapper.h
index ab2138e..7f857d7 100644
--- a/domain_wrapper.h
+++ b/domain_wrapper.h
@@ -27,6 +27,9 @@
 #ifndef LIBVIRT_GO_DOMAIN_WRAPPER_H__
 #define LIBVIRT_GO_DOMAIN_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "domain_compat.h"
 
 int virDomainCoreDumpWithFormatWrapper(virDomainPtr domain,
 				      const char *to,
diff --git a/events.go b/events.go
index 3f8d3a9..217b033 100644
--- a/events.go
+++ b/events.go
@@ -28,7 +28,6 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
 #include <stdint.h>
 #include "events_wrapper.h"
 */
diff --git a/events_wrapper.go b/events_wrapper.go
index 6e3416f..ffcffb9 100644
--- a/events_wrapper.go
+++ b/events_wrapper.go
@@ -28,8 +28,6 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include "events_wrapper.h"
diff --git a/events_wrapper.h b/events_wrapper.h
index 8420909..67b3624 100644
--- a/events_wrapper.h
+++ b/events_wrapper.h
@@ -27,6 +27,9 @@
 #ifndef LIBVIRT_GO_EVENTS_WRAPPER_H__
 #define LIBVIRT_GO_EVENTS_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+
 int virEventAddHandleWrapper(int fd, int events, int callbackID);
 int virEventAddTimeoutWrapper(int freq, int callbackID);
 void virEventRegisterImplWrapper(void);
diff --git a/lxc.go b/lxc.go
index 07ed7ff..ec685b8 100644
--- a/lxc.go
+++ b/lxc.go
@@ -33,9 +33,6 @@ package libvirt
 // Can't rely on pkg-config for libvirt-lxc since it was not
 // installed until 2.6.0 onwards
 #cgo LDFLAGS: -lvirt-lxc
-#include <libvirt/libvirt.h>
-#include <libvirt/libvirt-lxc.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
 #include <string.h>
 #include "lxc_wrapper.h"
diff --git a/lxc_wrapper.go b/lxc_wrapper.go
index 4a49348..0968870 100644
--- a/lxc_wrapper.go
+++ b/lxc_wrapper.go
@@ -31,8 +31,6 @@ package libvirt
 // Can't rely on pkg-config for libvirt-lxc since it was not
 // installed until 2.6.0 onwards
 #cgo LDFLAGS: -lvirt-lxc
-#include <libvirt/libvirt.h>
-#include <libvirt/libvirt-lxc.h>
 #include <assert.h>
 #include "lxc_wrapper.h"
 
diff --git a/lxc_wrapper.h b/lxc_wrapper.h
index 4004baf..4edef2a 100644
--- a/lxc_wrapper.h
+++ b/lxc_wrapper.h
@@ -27,7 +27,9 @@
 #ifndef LIBVIRT_GO_LXC_COMPAT_H__
 #define LIBVIRT_GO_LXC_COMPAT_H__
 
-/* 2.0.0 */
+#include <libvirt/libvirt.h>
+#include <libvirt/libvirt-lxc.h>
+#include <libvirt/virterror.h>
 
 int virDomainLxcEnterCGroupWrapper(virDomainPtr domain,
 				  unsigned int flags);
diff --git a/network.go b/network.go
index 26bf24e..015fe5e 100644
--- a/network.go
+++ b/network.go
@@ -28,10 +28,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
-#include "network_compat.h"
 #include "network_wrapper.h"
 */
 import "C"
diff --git a/network_events.go b/network_events.go
index fee2253..7414608 100644
--- a/network_events.go
+++ b/network_events.go
@@ -33,8 +33,6 @@ import (
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include "network_compat.h"
 #include "network_events_wrapper.h"
 */
 import "C"
diff --git a/network_events_wrapper.go b/network_events_wrapper.go
index 27bf555..a8a5d81 100644
--- a/network_events_wrapper.go
+++ b/network_events_wrapper.go
@@ -28,13 +28,10 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <assert.h>
-#include "network_compat.h"
+#include <stdint.h>
 #include "network_events_wrapper.h"
 #include "callbacks_wrapper.h"
-#include <stdint.h>
 
 extern void networkEventLifecycleCallback(virConnectPtr, virNetworkPtr, int, int, int);
 void networkEventLifecycleCallbackHelper(virConnectPtr c, virNetworkPtr d,
diff --git a/network_events_wrapper.h b/network_events_wrapper.h
index 8388467..8b08d00 100644
--- a/network_events_wrapper.h
+++ b/network_events_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_NETWORK_EVENTS_WRAPPER_H__
 #define LIBVIRT_GO_NETWORK_EVENTS_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "network_compat.h"
+
 void networkEventLifecycleCallbackHelper(virConnectPtr c, virNetworkPtr d,
                                      int event, int detail, void* data);
 
diff --git a/network_wrapper.go b/network_wrapper.go
index bd58754..5c797e0 100644
--- a/network_wrapper.go
+++ b/network_wrapper.go
@@ -28,9 +28,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
 #include <assert.h>
-#include "network_compat.h"
 #include "network_wrapper.h"
 
 void virNetworkDHCPLeaseFreeWrapper(virNetworkDHCPLeasePtr lease)
diff --git a/network_wrapper.h b/network_wrapper.h
index 762fe3b..66fb730 100644
--- a/network_wrapper.h
+++ b/network_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_NETWORK_WRAPPER_H__
 #define LIBVIRT_GO_NETWORK_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "network_compat.h"
+
 void virNetworkDHCPLeaseFreeWrapper(virNetworkDHCPLeasePtr lease);
 
 int virNetworkGetDHCPLeasesWrapper(virNetworkPtr network,
diff --git a/node_device_events.go b/node_device_events.go
index 969a134..5d66687 100644
--- a/node_device_events.go
+++ b/node_device_events.go
@@ -33,8 +33,6 @@ import (
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include "node_device_compat.h"
 #include "node_device_events_wrapper.h"
 */
 import "C"
diff --git a/node_device_events_wrapper.go b/node_device_events_wrapper.go
index 20441f4..a8b0c93 100644
--- a/node_device_events_wrapper.go
+++ b/node_device_events_wrapper.go
@@ -28,13 +28,10 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <assert.h>
-#include "node_device_compat.h"
+#include <stdint.h>
 #include "node_device_events_wrapper.h"
 #include "callbacks_wrapper.h"
-#include <stdint.h>
 
 extern void nodeDeviceEventLifecycleCallback(virConnectPtr, virNodeDevicePtr, int, int, int);
 void nodeDeviceEventLifecycleCallbackHelper(virConnectPtr c, virNodeDevicePtr d,
diff --git a/node_device_events_wrapper.h b/node_device_events_wrapper.h
index a9576e7..04cb71b 100644
--- a/node_device_events_wrapper.h
+++ b/node_device_events_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_NODE_DEVICE_EVENTS_WRAPPER_H__
 #define LIBVIRT_GO_NODE_DEVICE_EVENTS_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "node_device_compat.h"
+
 void nodeDeviceEventLifecycleCallbackHelper(virConnectPtr c, virNodeDevicePtr d,
                                          int event, int detail, void* data);
 
diff --git a/nwfilter_binding.go b/nwfilter_binding.go
index daab598..722303b 100644
--- a/nwfilter_binding.go
+++ b/nwfilter_binding.go
@@ -27,10 +27,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
-#include "nwfilter_binding_compat.h"
 #include "nwfilter_binding_wrapper.h"
 */
 import "C"
diff --git a/nwfilter_binding_wrapper.go b/nwfilter_binding_wrapper.go
index 4d0e086..fdafaef 100644
--- a/nwfilter_binding_wrapper.go
+++ b/nwfilter_binding_wrapper.go
@@ -27,9 +27,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
 #include <assert.h>
-#include "nwfilter_binding_compat.h"
 #include "nwfilter_binding_wrapper.h"
 
 const char *virNWFilterBindingGetPortDevWrapper(virNWFilterBindingPtr binding)
diff --git a/nwfilter_binding_wrapper.h b/nwfilter_binding_wrapper.h
index be09dca..895075f 100644
--- a/nwfilter_binding_wrapper.h
+++ b/nwfilter_binding_wrapper.h
@@ -26,6 +26,10 @@
 #ifndef LIBVIRT_GO_NWFILTER_BINDING_WRAPPER_H__
 #define LIBVIRT_GO_NWFILTER_BINDING_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "nwfilter_binding_compat.h"
+
 const char *virNWFilterBindingGetPortDevWrapper(virNWFilterBindingPtr binding);
 const char *virNWFilterBindingGetFilterNameWrapper(virNWFilterBindingPtr binding);
 char *virNWFilterBindingGetXMLDescWrapper(virNWFilterBindingPtr binding,
diff --git a/qemu.go b/qemu.go
index 678991f..3631b00 100644
--- a/qemu.go
+++ b/qemu.go
@@ -33,11 +33,7 @@ package libvirt
 // Can't rely on pkg-config for libvirt-qemu since it was not
 // installed until 2.6.0 onwards
 #cgo LDFLAGS: -lvirt-qemu
-#include <libvirt/libvirt.h>
-#include <libvirt/libvirt-qemu.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
-#include "qemu_compat.h"
 #include "qemu_wrapper.h"
 */
 import "C"
diff --git a/qemu_wrapper.go b/qemu_wrapper.go
index ff837a0..1dda84d 100644
--- a/qemu_wrapper.go
+++ b/qemu_wrapper.go
@@ -31,14 +31,10 @@ package libvirt
 // Can't rely on pkg-config for libvirt-qemu since it was not
 // installed until 2.6.0 onwards
 #cgo LDFLAGS: -lvirt-qemu
-#include <libvirt/libvirt.h>
-#include <libvirt/libvirt-qemu.h>
-#include <libvirt/virterror.h>
-#include "qemu_compat.h"
-#include "qemu_wrapper.h"
-#include "callbacks_wrapper.h"
 #include <assert.h>
 #include <stdint.h>
+#include "qemu_wrapper.h"
+#include "callbacks_wrapper.h"
 
 
 extern void domainQemuMonitorEventCallback(virConnectPtr, virDomainPtr, const char *, long long, unsigned int, const char *, int);
diff --git a/qemu_wrapper.h b/qemu_wrapper.h
index 3f4dd6a..228e444 100644
--- a/qemu_wrapper.h
+++ b/qemu_wrapper.h
@@ -27,6 +27,11 @@
 #ifndef LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__
 #define LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/libvirt-qemu.h>
+#include <libvirt/virterror.h>
+#include "qemu_compat.h"
+
 void domainQemuMonitorEventCallbackHelper(virConnectPtr c, virDomainPtr d,
 					const char *event, long long secs,
 					unsigned int micros, const char *details, void *data);
diff --git a/secret_events.go b/secret_events.go
index 5860033..d24146f 100644
--- a/secret_events.go
+++ b/secret_events.go
@@ -33,8 +33,6 @@ import (
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include "secret_compat.h"
 #include "secret_events_wrapper.h"
 */
 import "C"
diff --git a/secret_events_wrapper.go b/secret_events_wrapper.go
index 6e1ef21..04b5f4f 100644
--- a/secret_events_wrapper.go
+++ b/secret_events_wrapper.go
@@ -28,13 +28,10 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <assert.h>
-#include "secret_compat.h"
+#include <stdint.h>
 #include "secret_events_wrapper.h"
 #include "callbacks_wrapper.h"
-#include <stdint.h>
 
 extern void secretEventLifecycleCallback(virConnectPtr, virSecretPtr, int, int, int);
 void secretEventLifecycleCallbackHelper(virConnectPtr c, virSecretPtr d,
diff --git a/secret_events_wrapper.h b/secret_events_wrapper.h
index f388542..6758b54 100644
--- a/secret_events_wrapper.h
+++ b/secret_events_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_SECRET_EVENTS_WRAPPER_H__
 #define LIBVIRT_GO_SECRET_EVENTS_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "secret_compat.h"
+
 void secretEventLifecycleCallbackHelper(virConnectPtr c, virSecretPtr d,
                                      int event, int detail, void* data);
 void secretEventGenericCallbackHelper(virConnectPtr c, virSecretPtr d,
diff --git a/storage_pool_events.go b/storage_pool_events.go
index 6bd4a2f..15fb90b 100644
--- a/storage_pool_events.go
+++ b/storage_pool_events.go
@@ -33,8 +33,6 @@ import (
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include "storage_pool_compat.h"
 #include "storage_pool_events_wrapper.h"
 */
 import "C"
diff --git a/storage_pool_events_wrapper.go b/storage_pool_events_wrapper.go
index d03f6c5..df9b092 100644
--- a/storage_pool_events_wrapper.go
+++ b/storage_pool_events_wrapper.go
@@ -28,10 +28,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <assert.h>
-#include "storage_pool_compat.h"
 #include "storage_pool_events_wrapper.h"
 #include "callbacks_wrapper.h"
 #include <stdint.h>
diff --git a/storage_pool_events_wrapper.h b/storage_pool_events_wrapper.h
index 2420dee..f178951 100644
--- a/storage_pool_events_wrapper.h
+++ b/storage_pool_events_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_STORAGE_POOL_EVENTS_WRAPPER_H__
 #define LIBVIRT_GO_STORAGE_POOL_EVENTS_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "storage_pool_compat.h"
+
 void storagePoolEventLifecycleCallbackHelper(virConnectPtr c, virStoragePoolPtr d,
 					   int event, int detail, void* data);
 void storagePoolEventGenericCallbackHelper(virConnectPtr c, virStoragePoolPtr d,
diff --git a/storage_volume.go b/storage_volume.go
index 3526ed4..d913c59 100644
--- a/storage_volume.go
+++ b/storage_volume.go
@@ -28,10 +28,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
-#include "storage_volume_compat.h"
 #include "storage_volume_wrapper.h"
 */
 import "C"
diff --git a/storage_volume_wrapper.go b/storage_volume_wrapper.go
index 62c5df8..63cc2b5 100644
--- a/storage_volume_wrapper.go
+++ b/storage_volume_wrapper.go
@@ -28,9 +28,7 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
 #include <assert.h>
-#include "storage_volume_compat.h"
 #include "storage_volume_wrapper.h"
 
 int virStorageVolGetInfoFlagsWrapper(virStorageVolPtr vol,
diff --git a/storage_volume_wrapper.h b/storage_volume_wrapper.h
index a97a59a..77d75e0 100644
--- a/storage_volume_wrapper.h
+++ b/storage_volume_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_STORAGE_VOLUME_WRAPPER_H__
 #define LIBVIRT_GO_STORAGE_VOLUME_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "storage_volume_compat.h"
+
 int virStorageVolGetInfoFlagsWrapper(virStorageVolPtr vol,
 				    virStorageVolInfoPtr info,
 				    unsigned int flags);
diff --git a/stream.go b/stream.go
index 3fc89ab..c5c1ef7 100644
--- a/stream.go
+++ b/stream.go
@@ -28,11 +28,8 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdlib.h>
 #include "stream_wrapper.h"
-#include "stream_compat.h"
 */
 import "C"
 import (
diff --git a/stream_wrapper.go b/stream_wrapper.go
index 419bb41..90cc110 100644
--- a/stream_wrapper.go
+++ b/stream_wrapper.go
@@ -28,8 +28,6 @@ package libvirt
 
 /*
 #cgo pkg-config: libvirt
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <assert.h>
diff --git a/stream_wrapper.h b/stream_wrapper.h
index cfa6c37..b8417d3 100644
--- a/stream_wrapper.h
+++ b/stream_wrapper.h
@@ -27,6 +27,10 @@
 #ifndef LIBVIRT_GO_STREAM_WRAPPER_H__
 #define LIBVIRT_GO_STREAM_WRAPPER_H__
 
+#include <libvirt/libvirt.h>
+#include <libvirt/virterror.h>
+#include "stream_compat.h"
+
 int virStreamSendAllWrapper(virStreamPtr st, int callbackID);
 int virStreamRecvAllWrapper(virStreamPtr st, int callbackID);
 int virStreamSparseSendAllWrapper(virStreamPtr st, int callbackID, int holeCallbackID, int skipCallbackID);
-- 
2.17.1




More information about the libvir-list mailing list