[ovs-dev] [PATCH 1/5] lib/util.c: add ovs_windows_only() cpp macro

Eitan Eliahu eliahue at vmware.com
Tue Oct 21 23:25:38 UTC 2014


Acked-by: Eitan Eliahu <eliahue at vmware.com>

Thanks,
Eitan

-----Original Message-----
From: dev [mailto:dev-bounces at openvswitch.org] On Behalf Of Nithin Raju
Sent: Tuesday, October 21, 2014 4:11 PM
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH 1/5] lib/util.c: add ovs_windows_only() cpp macro

It is convenient to have a macro which we can use to wrap Windows
specific code without using the #ifdef _WIN32/#endif combo each time.

Signed-off-by: Nithin Raju <nithin at vmware.com>
---
 lib/util.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/util.h b/lib/util.h
index f171dbf..32f50e5 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -76,6 +76,14 @@
     }
 NO_RETURN void ovs_assert_failure(const char *, const char *, const char *);
 
+/* A convenient macro to wrap Windows specific code without having to use
+ * _WIN32 CPP. */
+#ifdef _WIN32
+#define ovs_windows_only(CONDITION) CONDITION
+#else
+#define ovs_windows_only(CONDITION)
+#endif
+
 /* Casts 'pointer' to 'type' and issues a compiler warning if the cast changes
  * anything other than an outermost "const" or "volatile" qualifier.
  *
-- 
1.7.4.1

_______________________________________________
dev mailing list
dev at openvswitch.org
https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=yTvML8OxA42Jb6ViHe7fUXbvPVOYDPVq87w43doxtlY%3D%0A&m=GjPPHrt8v8NG4G%2F6sYxMmxNAEHYMVYLgU9%2BaxxCkgTg%3D%0A&s=000a480412ff8e39e78dd0467b53923c1bee7c91e86fe1e2fa0385cc8ddad744



More information about the dev mailing list