[PATCH 08/15] Darwin: Move SNMP_CFRelease() definition

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
Define the SNMP_CFRelease() macro once instead of multiple times.
---
 agent/mibgroup/host/data_access/swinst_darwin.c | 3 +++
 include/net-snmp/system/darwin10.h              | 5 -----
 include/net-snmp/system/darwin11.h              | 5 -----
 include/net-snmp/system/darwin12.h              | 5 -----
 include/net-snmp/system/darwin13.h              | 5 -----
 include/net-snmp/system/darwin14.h              | 5 -----
 include/net-snmp/system/darwin9.h               | 5 -----
 7 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/agent/mibgroup/host/data_access/swinst_darwin.c b/agent/mibgroup/host/data_access/swinst_darwin.c
index c0f50fa39ba9..4612a483e119 100644
--- a/agent/mibgroup/host/data_access/swinst_darwin.c
+++ b/agent/mibgroup/host/data_access/swinst_darwin.c
@@ -43,6 +43,9 @@ static netsnmp_container *dirs = NULL;
 
 /* ---------------------------------------------------------------------
  */
+
+#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
+
 void
 netsnmp_swinst_arch_init( void )
 {
diff --git a/include/net-snmp/system/darwin10.h b/include/net-snmp/system/darwin10.h
index 2afd8bd1cbcd..97200c153c82 100644
--- a/include/net-snmp/system/darwin10.h
+++ b/include/net-snmp/system/darwin10.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin11.h b/include/net-snmp/system/darwin11.h
index f600aadebe3a..79271028875c 100644
--- a/include/net-snmp/system/darwin11.h
+++ b/include/net-snmp/system/darwin11.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin12.h b/include/net-snmp/system/darwin12.h
index 9cd8f1dd6a77..f74e7810c570 100644
--- a/include/net-snmp/system/darwin12.h
+++ b/include/net-snmp/system/darwin12.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin13.h b/include/net-snmp/system/darwin13.h
index e185fe2ea895..4a7d6b9df76e 100644
--- a/include/net-snmp/system/darwin13.h
+++ b/include/net-snmp/system/darwin13.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin14.h b/include/net-snmp/system/darwin14.h
index b54e3ae13fc7..0eb9a95cfd72 100644
--- a/include/net-snmp/system/darwin14.h
+++ b/include/net-snmp/system/darwin14.h
@@ -115,11 +115,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
diff --git a/include/net-snmp/system/darwin9.h b/include/net-snmp/system/darwin9.h
index e1f64a8cac38..b5d14c83382b 100644
--- a/include/net-snmp/system/darwin9.h
+++ b/include/net-snmp/system/darwin9.h
@@ -114,11 +114,6 @@
 /* #define USE_UNIFIED_IPV6_STRUCTS 1 */
 #undef STRUCT_in6pcb_HAS_inp_vflag
 
-/*
- * utility macro used in several darwin specific files
- */
-#define SNMP_CFRelease(x) do { if (x) { CFRelease(x); x = NULL; } } while(0)
-
 /*
  * Mac OS X runs on both PPC and Intel hardware,
  *   which handle udpTable index values differently
-- 
2.16.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.