From 5a273c9fab6a4fe3ab0c729e78f3a86d3e5a69ed Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 13 Jan 2013 11:24:56 -0800 Subject: Use standard autoconf defines for mkstemp & putenv instead of imake leftovers Signed-off-by: Alan Coopersmith --- auth.c | 10 +++++----- configure.ac | 5 +---- misc.c | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/auth.c b/auth.c index c8bc653..398e37c 100644 --- a/auth.c +++ b/auth.c @@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group. #include #include "auth.h" -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP #include #endif #include @@ -80,7 +80,7 @@ write_iceauth(FILE *addfp, FILE *removefp, IceAuthDataEntry *entry) -#ifndef HAS_MKSTEMP +#ifndef HAVE_MKSTEMP static char * unique_filename(const char *path, const char *prefix) #else @@ -88,7 +88,7 @@ static char * unique_filename(const char *path, const char *prefix, int *pFd) #endif { -#ifndef HAS_MKSTEMP +#ifndef HAVE_MKSTEMP #ifndef X_NOT_POSIX return ((char *) tempnam (path, prefix)); #else @@ -137,7 +137,7 @@ SetAuthentication(int count, IceListenObj *listenObjs, int original_umask; char command[256]; int i; -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP int fd; #endif @@ -150,7 +150,7 @@ SetAuthentication(int count, IceListenObj *listenObjs, if (!path) path = "."; } -#ifndef HAS_MKSTEMP +#ifndef HAVE_MKSTEMP if ((addAuthFile = unique_filename (path, ".xsm")) == NULL) goto bad; diff --git a/configure.ac b/configure.ac index bd4ceea..a2c5c20 100644 --- a/configure.ac +++ b/configure.ac @@ -45,10 +45,7 @@ AC_ARG_WITH(rsh, AS_HELP_STRING([--with-rsh=PATH], RSH=$rsh AC_SUBST(RSH) -AC_CHECK_FUNC([mkstemp], - AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the 'mkstemp' function.])) -AC_CHECK_FUNC([putenv], [], - AC_DEFINE(NOPUTENV,1,[Define to 1 if you DO NOT have the 'putenv' function.])) +AC_CHECK_FUNCS([mkstemp putenv]) # Checks for pkg-config packages PKG_CHECK_MODULES(XSM, [x11 xt > 1.0.99 ice sm xaw7]) diff --git a/misc.c b/misc.c index 3c4c636..c9367bd 100644 --- a/misc.c +++ b/misc.c @@ -28,7 +28,7 @@ in this Software without prior written authorization from The Open Group. #include "xsm.h" -#ifdef NOPUTENV +#ifndef HAVE_PUTENV /* * define our own putenv() if the system doesn't have one. * putenv(s): place s (a string of the form "NAME=value") in -- cgit v1.2.3