From f73ee14bd9f8d2f35b3f860c6f85f0c88d2465ab Mon Sep 17 00:00:00 2001 From: foobar Date: Tue, 23 Oct 2001 11:14:51 +0000 Subject: [PATCH] Check that realpath is available. Bug: #9469 # TSRM still uses it without checking. I can't fix that. --- configure.in | 1 + ext/standard/basic_functions.c | 2 +- ext/standard/file.c | 2 +- ext/standard/file.h | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 05ffbea347..d1c1587cce 100644 --- a/configure.in +++ b/configure.in @@ -395,6 +395,7 @@ mkstemp \ mmap \ nl_langinfo \ putenv \ +realpath \ random \ rand_r \ regcomp \ diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a8a630f972..efbbbf860e 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -628,7 +628,7 @@ function_entry basic_functions[] = { PHP_FE(socket_get_status, NULL) -#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS) +#if (!defined(PHP_WIN32) && !defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS) PHP_FE(realpath, NULL) #else PHP_FALIAS(realpath, warn_not_available, NULL) diff --git a/ext/standard/file.c b/ext/standard/file.c index df03be59e9..e4b91526ba 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2270,7 +2270,7 @@ PHP_FUNCTION(fgetcsv) /* }}} */ -#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS) +#if (!defined(PHP_WIN32) && !defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS) /* {{{ proto string realpath(string path) Return the resolved path */ PHP_FUNCTION(realpath) diff --git a/ext/standard/file.h b/ext/standard/file.h index e3cdc4aad9..853cf1342f 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -66,7 +66,9 @@ PHP_FUNCTION(flock); PHP_FUNCTION(fd_set); PHP_FUNCTION(fd_isset); PHP_FUNCTION(select); +#if (!defined(PHP_WIN32) && !defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS) PHP_FUNCTION(realpath); +#endif PHP_NAMED_FUNCTION(php_if_ftruncate); PHP_NAMED_FUNCTION(php_if_fstat); -- 2.40.0