summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArchana Holla <harchana@vmware.com>2020-04-07 11:09:33 -0700
committerWilliam Tu <u9012063@gmail.com>2020-04-07 14:15:00 -0700
commit8ea05f1f44dc720d96c1a0781e80a7e5d405c2b1 (patch)
tree504241b9a9e53c83222f01ffe00dabaac1398b4c /include
parent146f52b9ef8a5f61f39bfd5644638c7608ccceca (diff)
downloadopenvswitch-8ea05f1f44dc720d96c1a0781e80a7e5d405c2b1.tar.gz
util: Update OVS_TYPEOF macro for C++ enabled applications.
OVS_TYPEOF macro doesn’t return the type of object for non __GNUC__ platforms. Updating it to use "decltype" keyword when used from C++ code. Signed-off-by: Archana Holla <harchana@vmware.com> Signed-off-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/openvswitch/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/openvswitch/util.h b/include/openvswitch/util.h
index 9189e6480..228b185c3 100644
--- a/include/openvswitch/util.h
+++ b/include/openvswitch/util.h
@@ -85,6 +85,8 @@ OVS_NO_RETURN void ovs_assert_failure(const char *, const char *, const char *);
* assigned to OBJECT. */
#ifdef __GNUC__
#define OVS_TYPEOF(OBJECT) typeof(OBJECT)
+#elif defined (__cplusplus)
+#define OVS_TYPEOF(OBJECT) decltype(OBJECT)
#else
#define OVS_TYPEOF(OBJECT) void *
#endif