+#define mph_return_if_val_in_list5(var,a,b,c,d,e) \
+ do { \
+ int v = (var); \
+ if (v == a || v == b || v == c || v == d || v == e) \
+ return -1; \
+ } while (0)
+
+/*
+ * Helper function for functions which use ERANGE (such as getpwnam_r and
+ * getgrnam_r). These functions accept buffers which are dynamically
+ * allocated so that they're only as large as necessary. However, Linux and
+ * Mac OS X differ on how to signal an error value.
+ *
+ * Linux returns the error value directly, while Mac OS X is more traditional,
+ * returning -1 and setting errno accordingly.
+ *
+ * Unify the checking in one place.
+ */
+static inline int
+recheck_range (int ret)
+{
+ if (ret == ERANGE)
+ return 1;
+ if (ret == -1)
+ return errno == ERANGE;
+ return 0;
+}
+
+MPH_INTERNAL char*
+_mph_copy_structure_strings (
+ void *to, const size_t *to_offsets,
+ const void *from, const size_t *from_offsets,
+ size_t num_strings);
+