]> xenbits.xensource.com Git - libvirt.git/commitdiff
Deprecate the conn, dom and net fields in the _virError structure.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 23 May 2008 08:32:08 +0000 (08:32 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 23 May 2008 08:32:08 +0000 (08:32 +0000)
* include/libvirt/libvirt.h.in: Add VIR_DEPRECATED macro.
* src/internal.h: Internal code is allowed to use deprecated
features, so override VIR_DEPRECATED here.
* include/libvirt/virterror.h: Deprecate the conn, dom and net
fields in the _virError structure.

ChangeLog
include/libvirt/libvirt.h
include/libvirt/libvirt.h.in
include/libvirt/virterror.h
src/internal.h

index ea4c4a62a0d23e68ef61f1b519c31a42d3980f35..39a7236872a0128279e3916ac50cc2971dcd8c13 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri May 23 09:23:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
+
+       Deprecate the conn, dom and net fields in the _virError structure.
+       * include/libvirt/libvirt.h.in: Add VIR_DEPRECATED macro.
+       * src/internal.h: Internal code is allowed to use deprecated
+       features, so override VIR_DEPRECATED here.
+       * include/libvirt/virterror.h: Deprecate the conn, dom and net
+       fields in the _virError structure.
+
 Fri May 23 08:56:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
 
        Standardize use of header files, making internal.h primary.
index 1a6b720657d4a2632de6d64e50e94a6d06935622..d913b046d004e346fd39016b334a089e58dcd1e6 100644 (file)
@@ -1,4 +1,3 @@
-
 /* -*- c -*-
  * libvirt.h:
  * Summary: core interfaces for the libvirt library
 extern "C" {
 #endif
 
+#ifndef VIR_DEPRECATED
+  /* The feature is present in gcc-3.1 and newer.  */
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#  define VIR_DEPRECATED __attribute__((__deprecated__))
+# else
+#  define VIR_DEPRECATED /* nothing */
+# endif
+#endif /* VIR_DEPRECATED */
+
 /**
  * virConnect:
  *
index 76bd3e36feb1eabedca644eb4da15c7b84c04b91..f67aee7e5cd1c9e14145bf6bc3be3f530aff14cf 100644 (file)
@@ -1,4 +1,3 @@
-
 /* -*- c -*-
  * libvirt.h:
  * Summary: core interfaces for the libvirt library
 extern "C" {
 #endif
 
+#ifndef VIR_DEPRECATED
+  /* The feature is present in gcc-3.1 and newer.  */
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#  define VIR_DEPRECATED __attribute__((__deprecated__))
+# else
+#  define VIR_DEPRECATED /* nothing */
+# endif
+#endif /* VIR_DEPRECATED */
+
 /**
  * virConnect:
  *
index 75ee5f8cb3153f34970ac7eebd434fdaf148d14c..c575f9d048b26f42d9e4e0527c0f750e27a1dcd5 100644 (file)
@@ -76,14 +76,15 @@ struct _virError {
     int                domain; /* What part of the library raised this error */
     char       *message;/* human-readable informative error message */
     virErrorLevel level;/* how consequent is the error */
-    virConnectPtr conn;        /* connection if available, see note above */
-    virDomainPtr dom;  /* domain if available, see note above */
+    virConnectPtr conn VIR_DEPRECATED; /* connection if available,
+                                          see note above */
+    virDomainPtr dom VIR_DEPRECATED; /* domain if available, see note above */
     char       *str1;  /* extra string information */
     char       *str2;  /* extra string information */
     char       *str3;  /* extra string information */
     int                int1;   /* extra number information */
     int                int2;   /* extra number information */
-    virNetworkPtr net; /* network if available, see note above */
+    virNetworkPtr net VIR_DEPRECATED; /* network if available, see note above */
 };
 
 /**
index 3327ea13a426c9a42304514613a3a34864ce203b..c44d42f497a9b4b3a0c24e0b90931ba3e1aff116 100644 (file)
 #define pthread_mutex_unlock(lk) /*empty*/
 #endif
 
+/* The library itself is allowed to use deprecated functions /
+ * variables, so effectively undefine the deprecated attribute
+ * which would otherwise be defined in libvirt.h.
+ */
+#define VIR_DEPRECATED /*empty*/
+
 #include "gettext.h"
 
 #include "hash.h"