diff options
author | Anatol Belski <ab@php.net> | 2015-05-25 13:47:31 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-05-25 18:03:28 +0200 |
commit | c444c4172f219b7461e2d38e1bbd87f9eeb2a0cd (patch) | |
tree | f2cd1de69efe091997abe30d239dff3a1cbbb5c7 | |
parent | cfadcfc73486828b53ec45217fd00659a1a2e918 (diff) | |
download | php-git-c444c4172f219b7461e2d38e1bbd87f9eeb2a0cd.tar.gz |
further cleanups with S_IF* macros generalized declarations
-rw-r--r-- | Zend/zend_virtual_cwd.c | 8 | ||||
-rw-r--r-- | Zend/zend_virtual_cwd.h | 11 | ||||
-rw-r--r-- | ext/fileinfo/fileinfo.c | 4 | ||||
-rw-r--r-- | main/fopen_wrappers.c | 4 | ||||
-rw-r--r-- | main/main.c | 4 | ||||
-rw-r--r-- | main/php_ini.c | 4 | ||||
-rw-r--r-- | main/streams/php_streams_int.h | 4 | ||||
-rw-r--r-- | main/win95nt.h | 3 |
8 files changed, 11 insertions, 31 deletions
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index e880775ea7..5762666e6c 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -89,14 +89,6 @@ cwd_state main_cwd_state; /* True global */ #include <direct.h> #endif -#ifndef S_ISDIR -#define S_ISDIR(mode) ((mode) & _S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) ((mode) & _S_IFREG) -#endif - #ifdef TSRM_WIN32 #include <tchar.h> #define tsrm_strtok_r(a,b,c) _tcstok((a),(b)) diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h index 7e066f0016..64f78fe4af 100644 --- a/Zend/zend_virtual_cwd.h +++ b/Zend/zend_virtual_cwd.h @@ -337,6 +337,15 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void); #endif +/* Global stat declarations */ +#ifndef _S_IFDIR +#define _S_IFDIR S_IFDIR +#endif + +#ifndef _S_IFREG +#define _S_IFREG S_IFREG +#endif + #ifndef S_ISDIR #define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) #endif @@ -349,6 +358,8 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void); #define S_ISLNK(mode) (((mode)&S_IFMT) == S_IFLNK) #endif +#ifndef S_IXROOT #define S_IXROOT ( S_IXUSR | S_IXGRP | S_IXOTH ) +#endif #endif /* VIRTUAL_CWD_H */ diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 40df99df47..8663372de3 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -39,10 +39,6 @@ #include "fopen_wrappers.h" /* needed for is_url */ #include "Zend/zend_exceptions.h" -#ifndef _S_IFDIR -# define _S_IFDIR S_IFDIR -#endif - /* {{{ macros and type definitions */ typedef struct _php_fileinfo { zend_long options; diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 85127c3379..a4c6e4a6db 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -53,10 +53,6 @@ #include <sys/socket.h> #endif -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - #ifdef PHP_WIN32 #include <winsock2.h> #elif defined(NETWARE) && defined(USE_WINSOCK) diff --git a/main/main.c b/main/main.c index ebaaa2a8e4..2d58b9c99c 100644 --- a/main/main.c +++ b/main/main.c @@ -114,10 +114,6 @@ #endif /* }}} */ -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - PHPAPI int (*php_register_internal_extensions_func)(void) = php_register_internal_extensions; #ifndef ZTS diff --git a/main/php_ini.c b/main/php_ini.c index 80d34848f8..99919ca56e 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -37,10 +37,6 @@ #include <dirent.h> #endif -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - #ifdef PHP_WIN32 #define TRANSLATE_SLASHES_LOWER(path) \ { \ diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index c47c666178..0188202c91 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -55,10 +55,6 @@ # define EWOULDBLOCK WSAEWOULDBLOCK #endif -#ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) -#endif - /* This functions transforms the first char to 'w' if it's not 'r', 'a' or 'w' * and strips any subsequent chars except '+' and 'b'. * Use this to sanitize stream->mode if you call e.g. fdopen, fopencookie or diff --git a/main/win95nt.h b/main/win95nt.h index adf9f61e34..12356eeccd 100644 --- a/main/win95nt.h +++ b/main/win95nt.h @@ -40,9 +40,6 @@ typedef char * caddr_t; #define S_IFIFO _IFIFO #define S_IFBLK _IFBLK #define S_IFLNK _IFLNK -#ifndef S_ISREG -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif #define chdir(path) _chdir(path) #define mkdir(a, b) _mkdir(a) #define rmdir(a) _rmdir(a) |