summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/core/utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 3c6fc98e..41bbc279 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -15,6 +15,10 @@
#define OSMO_MAX(a, b) ((a) >= (b) ? (a) : (b))
/*! \brief Return the minimum of two specified values */
#define OSMO_MIN(a, b) ((a) >= (b) ? (b) : (a))
+/*! \brief Stringify the contents of a macro, e.g. a port number */
+#define OSMO_STRINGIFY(x) #x
+/*! \brief Make a value_string entry from an enum value name */
+#define OSMO_VALUE_STRING(x) { x, OSMO_STRINGIFY(x) }
#include <stdint.h>