further cleanups with S_IF* macros generalized declarations

This commit is contained in:
Anatol Belski 2015-05-25 13:47:31 +02:00
parent cfadcfc734
commit c444c4172f
8 changed files with 11 additions and 31 deletions

View file

@ -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))

View file

@ -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 */

View file

@ -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;

View file

@ -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)

View file

@ -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

View file

@ -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) \
{ \

View file

@ -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

View file

@ -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)