the putenv replacement did nothing except call abort().
There is no platform (yet) which did not have putenv()
but did have fork(). For this reason, the assert()
has yet to be hit, meaning that the stub itself is
pointless.
If in the future a platform is found to have fork() but
not putenv(), then the related tests need to be disabled
at compile time using something like
#if defined(HAVE_DECL_PUTENV)
along with a related AC_CHECK_DECLS check.
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@986
64e312b2-a51f-0410-8e61-
82d0ca0eb02a
check_function_exists(localtime_r HAVE_DECL_LOCALTIME_R)
check_function_exists(localtime_s HAVE_LOCALTIME_S)
check_function_exists(malloc HAVE_MALLOC)
-check_function_exists(putenv HAVE_DECL_PUTENV)
check_function_exists(realloc HAVE_REALLOC)
check_function_exists(setenv HAVE_DECL_SETENV)
check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(unsetenv HAVE_DECL_UNSETENV)
check_function_exists(_getpid HAVE__GETPID)
check_function_exists(_localtime64_s HAVE__LOCALTIME64_S)
-check_function_exists(_putenv HAVE__PUTENV)
check_function_exists(_strdup HAVE__STRDUP)
if(HAVE_FORK)
HW_LIBRT_TIMERS
# The following checks will replace missing functions from libcompat
-AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r putenv sleep strdup strsignal unsetenv])
-AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, putenv, sleep, strdup, strsignal, unsetenv])
+AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r sleep strdup strsignal unsetenv])
+AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, sleep, strdup, strsignal, unsetenv])
# The following checks are to only detect if the functions exist, but
# not replace them
set(SOURCES ${SOURCES} malloc.c)
endif(NOT HAVE_MALLOC)
-if(NOT HAVE_DECL_PUTENV AND NOT HAVE__PUTENV)
- set(SOURCES ${SOURCES} putenv.c)
-endif(NOT HAVE_DECL_PUTENV AND NOT HAVE__PUTENV)
-
if(NOT HAVE_REALLOC)
set(SOURCES ${SOURCES} realloc.c)
endif(NOT HAVE_REALLOC)
#endif
#endif /* !HAVE_DECL_LOCALTIME_R */
-#if !HAVE_DECL_PUTENV && !HAVE__PUTENV
-CK_DLL_EXP int putenv (const char *string);
-#elif !HAVE_DECL_PUTENV && HAVE__PUTENV
-#define putenv _putenv;
-#endif /* HAVE_DECL_PUTENV && !HAVE__PUTENV */
-
#if !HAVE_DECL_SLEEP
CK_DLL_EXP unsigned int sleep (unsigned int seconds);
#endif /* !HAVE_DECL_SLEEP */
+++ /dev/null
-#include "libcompat.h"
-
-int
-putenv (const char *string CK_ATTRIBUTE_UNUSED)
-{
- assert (0);
- return 0;
-}