Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* SOFTWARE.
*/
+/*
+ * This compat wrapper can be removed and replaced by g_mkdtemp() when we bump
+ * the requirement on glib to version 2.30.
+ */
+
#include <stdlib.h>
#include <sys/stat.h>
+#include <glib.h>
#ifdef HAVE_MKDTEMP
+
static inline
char *bt_mkdtemp(char *template)
{
return mkdtemp(template);
}
+
+#elif GLIB_CHECK_VERSION(2,30,0)
+
+#include <glib/gstdio.h>
+static inline
+char *bt_mkdtemp(char *template)
+{
+ return g_mkdtemp(template);
+}
+
#else
+
static inline
char *bt_mkdtemp(char *template)
{
end:
return ret;
}
-#endif
+#endif
#endif /* _BABELTRACE_COMPAT_STDLIB_H */