On 11/11/2014 11:08 AM, Stef Walter wrote:
Could you use the HAVE_SETENV defines that AC_CHECK_FUNCS gives you in
order to guard this define?
Other than that the patch looks good.
I'd be surprised if setenv() was added to a Win32 compiler suite, but I've
added it.
Thanks,
Michael
>From 460007fecb1f809fca13eacb79b686671aa6e028 Mon Sep 17 00:00:00 2001
From: Michael Cronenworth <mcronenwo...@pdxinc.com>
Date: Tue, 11 Nov 2014 11:18:17 -0600
Subject: [PATCH] compat: Add definition for setenv for Win32
Signed-off-by: Michael Cronenworth <m...@cchtml.com>
---
common/compat.h | 4 ++++
configure.ac | 1 +
2 files changed, 5 insertions(+)
diff --git a/common/compat.h b/common/compat.h
index 6483d4f..acbccf9 100644
--- a/common/compat.h
+++ b/common/compat.h
@@ -165,6 +165,10 @@ p11_mmap * p11_mmap_open (const char *path,
void p11_mmap_close (p11_mmap *map);
+#ifndef HAVE_SETENV
+#define setenv(n, v, z) _putenv_s(n, v)
+#endif /* HAVE_SETENV */
+
#endif /* OS_WIN32 */
/* ----------------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 8a1939f..02ea526 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,7 @@ if test "$os_unix" = "yes"; then
AC_CHECK_FUNCS([asprintf vasprintf vsnprintf])
AC_CHECK_FUNCS([timegm])
AC_CHECK_FUNCS([fdwalk])
+ AC_CHECK_FUNCS([setenv])
AC_CHECK_DECLS([asprintf, vasprintf], [], [], [[#include <stdio.h>]])
--
1.9.3
_______________________________________________
p11-glue mailing list
p11-glue@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/p11-glue