summaryrefslogtreecommitdiff
path: root/include/openvswitch/util.h
diff options
context:
space:
mode:
authorThomas Graf <tgraf@noironetworks.com>2014-12-15 14:10:38 +0100
committerThomas Graf <tgraf@noironetworks.com>2014-12-15 14:14:58 +0100
commit8f3676cfce4e6a9e8428d5f171d6246622486fbc (patch)
tree93d314ac492c629bcc985d860fa6a65b104bcd60 /include/openvswitch/util.h
parentcab5044987845e66dbe030eb1384d58cc5a66fc9 (diff)
downloadopenvswitch-8f3676cfce4e6a9e8428d5f171d6246622486fbc.tar.gz
lib: Expose SOURCE_LOCATOR as OVS_SOURCE_LOACATOR
Required to expose headers which depend on SOURCE_LOCATOR Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/openvswitch/util.h')
-rw-r--r--include/openvswitch/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/openvswitch/util.h b/include/openvswitch/util.h
index b2b20a562..b0b9935ef 100644
--- a/include/openvswitch/util.h
+++ b/include/openvswitch/util.h
@@ -32,6 +32,14 @@ void ovs_set_program_name__(const char *name, const char *version,
const char *ovs_get_program_name(void);
const char *ovs_get_program_version(void);
+/* Expands to a string that looks like "<file>:<line>", e.g. "tmp.c:10".
+ *
+ * See http://c-faq.com/ansi/stringize.html for an explanation of OVS_STRINGIZE
+ * and OVS_STRINGIZE2. */
+#define OVS_SOURCE_LOCATOR __FILE__ ":" OVS_STRINGIZE(__LINE__)
+#define OVS_STRINGIZE(ARG) OVS_STRINGIZE2(ARG)
+#define OVS_STRINGIZE2(ARG) #ARG
+
#ifdef __cplusplus
}
#endif