aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
diff options
context:
space:
mode:
Diffstat (limited to 'epan/proto.h')
-rw-r--r--epan/proto.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/proto.h b/epan/proto.h
index 10c8fe57e5..62514708c3 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -82,6 +82,14 @@ struct expert_field;
#define TFS(x) (const struct true_false_string*)(x)
typedef void (*custom_fmt_func_t)(gchar *, guint32);
+/** Make a custom format function pointer look like a void pointer. Used to set header_field_info.strings.
+ *
+ * We cast to gsize first, which 1) is guaranteed to be wide enough to
+ * hold a pointer and 2) lets us side-step warnings about casting function
+ * pointers to 'void *'. This violates ISO C but should be fine on POSIX
+ * and Windows.
+ */
+#define CF_FUNC(x) ((const void *) (gsize) (x))
/** Make a const range_string[] look like a _range_string pointer, used to set
* header_field_info.strings */