mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
replace the stack var by a macro
This commit is contained in:
parent
9470b2016c
commit
9ad0d0ca3c
4 changed files with 8 additions and 12 deletions
|
@ -116,17 +116,15 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now)
|
||||||
} else {
|
} else {
|
||||||
spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename); /* SAFE */
|
spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename); /* SAFE */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VCWD_ACCESS(libpath, F_OK)) {
|
if (VCWD_ACCESS(libpath, F_OK)) {
|
||||||
/* If file does not exist, consider as extension name and build file name */
|
/* If file does not exist, consider as extension name and build file name */
|
||||||
const char *libpath_prefix = "";
|
|
||||||
char *orig_libpath = libpath;
|
char *orig_libpath = libpath;
|
||||||
#if PHP_WIN32
|
|
||||||
libpath_prefix = "php_";
|
|
||||||
#endif
|
|
||||||
if (slash_suffix) {
|
if (slash_suffix) {
|
||||||
spprintf(&libpath, 0, "%s%s%s." PHP_SHLIB_SUFFIX, extension_dir, libpath_prefix, filename); /* SAFE */
|
spprintf(&libpath, 0, "%s" PHP_SHLIB_EXT_PREFIX "%s." PHP_SHLIB_SUFFIX, extension_dir, filename); /* SAFE */
|
||||||
} else {
|
} else {
|
||||||
spprintf(&libpath, 0, "%s%c%s%s." PHP_SHLIB_SUFFIX, extension_dir, DEFAULT_SLASH, libpath_prefix, filename); /* SAFE */
|
spprintf(&libpath, 0, "%s%c" PHP_SHLIB_EXT_PREFIX "%s." PHP_SHLIB_SUFFIX, extension_dir, DEFAULT_SLASH, filename); /* SAFE */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VCWD_ACCESS(libpath, F_OK)) {
|
if (VCWD_ACCESS(libpath, F_OK)) {
|
||||||
|
|
|
@ -89,3 +89,4 @@
|
||||||
#define PHP_CONFIG_FILE_PATH "@EXPANDED_PHP_CONFIG_FILE_PATH@"
|
#define PHP_CONFIG_FILE_PATH "@EXPANDED_PHP_CONFIG_FILE_PATH@"
|
||||||
#define PHP_CONFIG_FILE_SCAN_DIR "@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
|
#define PHP_CONFIG_FILE_SCAN_DIR "@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
|
||||||
#define PHP_SHLIB_SUFFIX "@SHLIB_DL_SUFFIX_NAME@"
|
#define PHP_SHLIB_SUFFIX "@SHLIB_DL_SUFFIX_NAME@"
|
||||||
|
#define PHP_SHLIB_EXT_PREFIX ""
|
||||||
|
|
|
@ -375,16 +375,12 @@ static void php_load_zend_extension_cb(void *arg)
|
||||||
|
|
||||||
if (VCWD_ACCESS(libpath, F_OK)) {
|
if (VCWD_ACCESS(libpath, F_OK)) {
|
||||||
/* If file does not exist, consider as extension name and build file name */
|
/* If file does not exist, consider as extension name and build file name */
|
||||||
const char *libpath_prefix = "";
|
|
||||||
char *orig_libpath = libpath;
|
char *orig_libpath = libpath;
|
||||||
#if PHP_WIN32
|
|
||||||
libpath_prefix = "php_";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (slash_suffix) {
|
if (slash_suffix) {
|
||||||
spprintf(&libpath, 0, "%s%s%s." PHP_SHLIB_SUFFIX, extension_dir, libpath_prefix, filename); /* SAFE */
|
spprintf(&libpath, 0, "%s" PHP_SHLIB_EXT_PREFIX "%s." PHP_SHLIB_SUFFIX, extension_dir, filename); /* SAFE */
|
||||||
} else {
|
} else {
|
||||||
spprintf(&libpath, 0, "%s%c%s%s." PHP_SHLIB_SUFFIX, extension_dir, DEFAULT_SLASH, libpath_prefix, filename); /* SAFE */
|
spprintf(&libpath, 0, "%s%c" PHP_SHLIB_EXT_PREFIX "%s." PHP_SHLIB_SUFFIX, extension_dir, DEFAULT_SLASH, filename); /* SAFE */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VCWD_ACCESS(libpath, F_OK)) {
|
if (VCWD_ACCESS(libpath, F_OK)) {
|
||||||
|
|
|
@ -136,6 +136,7 @@
|
||||||
#define HAVE_FNMATCH
|
#define HAVE_FNMATCH
|
||||||
#define HAVE_GLOB
|
#define HAVE_GLOB
|
||||||
#define PHP_SHLIB_SUFFIX "dll"
|
#define PHP_SHLIB_SUFFIX "dll"
|
||||||
|
#define PHP_SHLIB_EXT_PREFIX "php_"
|
||||||
#define HAVE_SQLDATASOURCES
|
#define HAVE_SQLDATASOURCES
|
||||||
|
|
||||||
/* Win32 supports strcoll */
|
/* Win32 supports strcoll */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue