From e12c2fd3b5348f2995644c17b9bf268d037adc09 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 25 Nov 2021 22:03:00 -0800 Subject: [PATCH] remove getenv detection The code base extensively uses `getenv` without checking the `HAVE_GETENV` macro this detection supplies. This is not a problem because `getenv` is provided as far back as C89, and can be guaranteed to exist on all platforms for which Graphviz currently compiles, as we require C99. --- cmake/config_checks.cmake | 1 - config-cmake.h.in | 1 - configure.ac | 2 +- windows/include/config.h | 3 --- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake index c53963a13..28cb2fc48 100644 --- a/cmake/config_checks.cmake +++ b/cmake/config_checks.cmake @@ -24,7 +24,6 @@ include(CheckFunctionExists) check_function_exists( dl_iterate_phdr HAVE_DL_ITERATE_PHDR ) check_function_exists( drand48 HAVE_DRAND48 ) check_function_exists( getpagesize HAVE_GETPAGESIZE ) -check_function_exists( getenv HAVE_GETENV ) check_function_exists( lrand48 HAVE_LRAND48 ) check_function_exists( setenv HAVE_SETENV ) check_function_exists( setmode HAVE_SETMODE ) diff --git a/config-cmake.h.in b/config-cmake.h.in index 4948011b7..0272b8b23 100644 --- a/config-cmake.h.in +++ b/config-cmake.h.in @@ -20,7 +20,6 @@ #cmakedefine HAVE_DL_ITERATE_PHDR #cmakedefine HAVE_DRAND48 #cmakedefine HAVE_GETPAGESIZE -#cmakedefine HAVE_GETENV #cmakedefine HAVE_LRAND48 #cmakedefine HAVE_SETENV #cmakedefine HAVE_SETMODE diff --git a/configure.ac b/configure.ac index af448cf8d..7f2bac195 100644 --- a/configure.ac +++ b/configure.ac @@ -456,7 +456,7 @@ LIBS=$save_LIBS # ----------------------------------- # Checks for library functions -AC_CHECK_FUNCS([lrand48 drand48 srand48 setmode setenv getenv \ +AC_CHECK_FUNCS([lrand48 drand48 srand48 setmode setenv \ getpagesize \ ftruncate lseek64 stat64 select dl_iterate_phdr]) diff --git a/windows/include/config.h b/windows/include/config.h index 5681eb614..c58e1616b 100644 --- a/windows/include/config.h +++ b/windows/include/config.h @@ -96,9 +96,6 @@ /* Define if the GD library supports XPM */ /* #undef HAVE_GD_XPM */ -/* Define to 1 if you have the `getenv' function. */ -#define HAVE_GETENV 1 - /* Define if you have the glade library */ #define HAVE_GLADE 1 -- 2.40.0