%{
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
#include <winsock.h>
#include <io.h>
#endif
# ifdef HAVE_STDIOSTREAM_H
# include <stdiostream.h>
# endif
-# if ZEND_WIN32
+# ifdef ZEND_WIN32
# include <strstrea.h>
# else
# include <strstream.h>
/* redefine YY_INPUT to handle urls for win32*/
-#if 0 /*ZEND_WIN32*/
+#if 0 /*defined(ZEND_WIN32)*/
#define YY_INPUT(buf,result,max_size) \
if ( yyin->_tmpfname != "url" ){ \
if ( yy_current_buffer->yy_is_interactive ) \
* general definitions
*/
-#if (defined(WINNT) && WINNT) || (defined(WIN32) && WIN32)
-#define ZEND_WIN32 1
-#else
-#define ZEND_WIN32 0
-#endif
-
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
# include "zend_config.w32.h"
#else
# include "zend_config.h"
# define DL_FETCH_SYMBOL dlsym
# define DL_HANDLE void *
# define ZEND_EXTENSIONS_SUPPORT 1
-#elif (ZEND_WIN32)
+#elif defined(ZEND_WIN32)
# define DL_LOAD(libname) LoadLibrary(libname)
# define DL_FETCH_SYMBOL GetProcAddress
# define DL_UNLOAD FreeLibrary
#define ZEND_MAX_RESERVED_RESOURCES 1
-#if (ZEND_WIN32)
+#ifdef ZEND_WIN32
/* Only use this macro if you know for sure that all of the switches values
are covered by its case statements */
#define EMPTY_SWITCH_DEFAULT_CASE() \
#define BYREF_ALLOW 2
#define BYREF_FORCE_REST 3
-#if !(ZEND_WIN32)
+#ifndef ZEND_WIN32
#define DLEXPORT
#endif
vsprintf(output_buf, format, args);
va_end(args);
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
OutputDebugString(output_buf);
#else
fprintf(stderr, output_buf);
/* This will cause the compilation process to be MUCH longer, but will generate
* a much quicker PHP binary
*/
-#ifdef ZEND_WIN32_FORCE_INLINE
+#ifdef defined(ZEND_WIN32)_FORCE_INLINE
# define inline __forceinline
#else
# define inline
int zend_startup_constants(ELS_D)
{
-#if ZEND_WIN32
+#ifdef ZEND_WIN32
DWORD dwBuild=0;
DWORD dwVersion = GetVersion();
DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
#endif
-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && (ZEND_WIN32))
+#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32))
# define do_alloca(p) alloca(p)
# define free_alloca(p)
#else
handle = DL_LOAD(path);
if (!handle) {
-#if !(ZEND_WIN32)
+#ifndef ZEND_WIN32
fprintf(stderr, "Failed loading %s: %s\n", path, dlerror());
#else
fprintf(stderr, "Failed loading %s\n", path);
#include "safe_mode.h"
#include "fopen-wrappers.h"
#include <string.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <windows.h>
#else
#include <sys/param.h>
#if !(WIN32|WINNT)
int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath)
{
-#if PHP_WIN32
+#ifdef PHP_WIN32
int tsm_err;
#else
FILE *sendmail;
int ret;
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
if (imap_TSendMail(INI_STR("smtp"),&tsm_err,headers,subject,to,message,cc,bcc,rpath) != SUCCESS){
php_error(E_WARNING, GetSMErrorText(tsm_err));
return 0;
#include <dirent.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#define NEEDRDH 1
#include "win32/readdir.h"
#endif
PS_MOD(files)
};
-#if PHP_WIN32
+#ifdef PHP_WIN32
#define DIR_DELIMITER '\\'
#else
#define DIR_DELIMITER '/'
#include "php.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/time.h"
#else
#include <sys/time.h>
#endif
#include "php_snmp.h"
#include <sys/types.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <winsock.h>
#include <errno.h>
#include <process.h>
#else
#include <strings.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/unistd.h"
#endif
#include "zend_globals.h"
#include <locale.h>
#endif
#include "safe_mode.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/unistd.h"
#endif
#include "zend_globals.h"
PHP_FE(gethostbyaddr, NULL)
PHP_FE(gethostbyname, NULL)
PHP_FE(gethostbynamel, NULL)
-#if !(PHP_WIN32)||HAVE_BINDLIB
+#if !defined(PHP_WIN32)||HAVE_BINDLIB
PHP_FE(checkdnsrr, NULL)
PHP_FE(getmxrr, second_and_third_args_force_ref)
#endif
PHP_FUNCTION(extension_loaded);
PHP_FUNCTION(get_extension_funcs);
-#if PHP_WIN32
+#ifdef PHP_WIN32
typedef unsigned int php_stat_len;
#else
typedef int php_stat_len;
#include <strings.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <process.h>
extern char *crypt(char *__key,char *__salt);
#endif
#include <errno.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#define NEEDRDH 1
#include "win32/readdir.h"
#endif
#else
#include <strings.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/param.h"
#include "win32/winutil.h"
#else
} else {
error_type = E_CORE_ERROR;
}
-#if PHP_WIN32
+#ifdef PHP_WIN32
php_error(error_type,"Unable to load dynamic library '%s'<br>\n%s",libpath,php_win_err());
#else
php_error(error_type,"Unable to load dynamic library '%s' - %s",libpath,dlerror());
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#if HAVE_BINDLIB
#ifndef WINNT
#define WINNT 1
return estrdup(inet_ntoa(in));
}
-#if !(PHP_WIN32)||HAVE_BINDLIB
+#if !defined(PHP_WIN32)||HAVE_BINDLIB
/* {{{ proto int checkdnsrr(string host [, string type])
Check DNS records corresponding to a given Internet host name or IP address */
PHP_FUNCTION(gethostbyaddr);
PHP_FUNCTION(gethostbyname);
PHP_FUNCTION(gethostbynamel);
-#if !(PHP_WIN32)||(HAVE_BINDLIB)
+#if !defined(PHP_WIN32)||(HAVE_BINDLIB)
PHP_FUNCTION(checkdnsrr);
PHP_FUNCTION(getmxrr);
#endif
tmp = php_escape_shell_cmd(d);
efree(d);
d = tmp;
-#if PHP_WIN32
+#ifdef PHP_WIN32
fp = popen(d, "rb");
#else
fp = popen(d, "r");
return -1;
}
} else { /* not safe_mode */
-#if PHP_WIN32
+#ifdef PHP_WIN32
fp = popen(cmd, "rb");
#else
fp = popen(cmd, "r");
}
convert_to_string_ex(cmd);
-#if PHP_WIN32
+#ifdef PHP_WIN32
if ((in=popen((*cmd)->value.str.val,"rt"))==NULL) {
#else
if ((in=popen((*cmd)->value.str.val,"r"))==NULL) {
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <windows.h>
#include <winsock.h>
#define O_RDONLY _O_RDONLY
#include "php_string.h"
#include "file.h"
#if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <winsock.h>
#else
#include <netinet/in.h>
int flags;
int myflag = 0;
-#if PHP_WIN32
+#ifdef PHP_WIN32
/* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
flags = block;
if (ioctlsocket(socketd,FIONBIO,&flags)==SOCKET_ERROR){
RETURN_FALSE;
}
-#if PHP_WIN32
+#ifdef PHP_WIN32
if ((fd_s=open((*source)->value.str.val,O_RDONLY|_O_BINARY))==-1) {
#else
if ((fd_s=open((*source)->value.str.val,O_RDONLY))==-1) {
php_error(E_WARNING,"Unable to open '%s' for reading: %s",(*source)->value.str.val,strerror(errno));
RETURN_FALSE;
}
-#if PHP_WIN32
+#ifdef PHP_WIN32
if ((fd_t=open((*target)->value.str.val,_O_WRONLY|_O_CREAT|_O_TRUNC|_O_BINARY,_S_IREAD|_S_IWRITE))==-1){
#else
if ((fd_t=creat((*target)->value.str.val,0777))==-1) {
#endif
#if HAVE_PWD_H
-# if PHP_WIN32
+# ifdef PHP_WIN32
# include "win32/pwd.h"
# else
# include <pwd.h>
#endif
#if HAVE_GRP_H
-# if PHP_WIN32
+# ifdef PHP_WIN32
# include "win32/grp.h"
# else
# include <grp.h>
#endif
#if HAVE_UTIME
-# if PHP_WIN32
+# ifdef PHP_WIN32
# include <sys/utime.h>
# else
# include <utime.h>
#include <fcntl.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <windows.h>
#include <io.h>
#endif
return ret;
}
-#elif PHP_WIN32
+#elif defined(PHP_WIN32)
/*
* Program: Unix compatibility routines
*
/* Under Win32 MT library, errno is not a variable but a function call,
* which cannot be assigned to.
*/
-#if !(PHP_WIN32)
+#if !defined(PHP_WIN32)
errno = EINVAL; /* bad call */
#endif
return -1;
int flock(int fd, int operation);
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
# define fsync _commit
# define ftruncate chsize
-#endif /* PHP_WIN32 */
+#endif /* defined(PHP_WIN32) */
#if !HAVE_INET_ATON
#if HAVE_NETINET_IN_H
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <winsock.h>
#else
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#undef AF_UNIX
#endif
#if defined(AF_UNIX)
#define SEARCHCR() \
p = memchr(READPTR(sock), '\n', MIN(TOREAD(sock), maxlen));
-#if PHP_WIN32
+#ifdef PHP_WIN32
#define EWOULDBLOCK WSAEWOULDBLOCK
#else
#include "build-defs.h"
struct timeval *timeout)
{
/* probably won't work on Win32, someone else might try it (read: fix it ;) */
-#if !PHP_WIN32 && (defined(O_NONBLOCK) || defined(O_NDELAY))
+#if !defined(PHP_WIN32) && (defined(O_NONBLOCK) || defined(O_NDELAY))
#ifndef O_NONBLOCK
#define O_NONBLOCK O_NDELAY
ret = -1;
}
return ret;
-#else /* !PHP_WIN32 && ... */
+#else /* !defined(PHP_WIN32) && ... */
return connect(sockfd, addr, addrlen);
#endif
}
return ret;
}
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
#undef closesocket
#define closesocket close
#endif
#ifndef _FSOCK_H
#define _FSOCK_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
# ifndef WINNT
# define WINNT 1
# endif
#include "ext/standard/head.h"
#include "info.h"
#include "SAPI.h"
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
#include "build-defs.h"
#endif
#include "zend_globals.h" /* needs ELS */
char **env,*tmp1,*tmp2;
char *php_uname;
int expose_php = INI_INT("expose_php");
-#if PHP_WIN32
+#ifdef PHP_WIN32
char php_windows_uname[256];
DWORD dwBuild=0;
DWORD dwVersion = GetVersion();
if (flag & PHP_INFO_GENERAL) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
// Get build numbers for Windows NT or Win95
if (dwVersion < 0x80000000){
dwBuild = (DWORD)(HIWORD(dwVersion));
static php_lcg_globals lcg_globals;
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <process.h>
#endif
#include <sys/stat.h>
#include <string.h>
#if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#endif
#endif
#if HAVE_GRP_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/grp.h"
#else
#include <grp.h>
#include <ctype.h>
#include <stdio.h>
#include "php.h"
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
#include "build-defs.h"
#endif
#include "php_mail.h"
#include "php_ini.h"
#if HAVE_SENDMAIL
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/sendmail.h"
#endif
int php_mail(char *to, char *subject, char *message, char *headers)
{
-#if PHP_WIN32
+#ifdef PHP_WIN32
int tsm_err;
#else
FILE *sendmail;
char *sendmail_path = INI_STR("sendmail_path");
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
if (TSendMail(INI_STR("SMTP"), &tsm_err, headers, subject, to, message) != SUCCESS){
php_error(E_WARNING, GetSMErrorText(tsm_err));
return 0;
PHP_MINFO_FUNCTION(mail)
{
-#if PHP_WIN32
+#ifdef PHP_WIN32
PUTS("Internal Sendmail support for Windows 4");
#else
php_printf("Path to sendmail: <tt>%s</tt>", INI_STR("sendmail_path"));
#include <stdio.h>
#ifdef HAVE_GETTIMEOFDAY
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/time.h"
#else
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <windows.h>
#include <winsock.h>
#define O_RDONLY _O_RDONLY
#include "php_string.h"
#include "pack.h"
#if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#include <unistd.h>
#endif
#include <sys/stat.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <process.h>
#endif
#include "php.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <malloc.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
# include "win32/time.h"
#endif
ret = estrdup((*str)->value.str.val);
c = ret + (*str)->value.str.len -1;
while (*c == '/'
-#if PHP_WIN32
+#ifdef PHP_WIN32
|| *c == '\\'
#endif
)
c--;
*(c + 1) = '\0';
if ((c = strrchr(ret, '/'))
-#if PHP_WIN32
+#ifdef PHP_WIN32
|| (c = strrchr(ret, '\\'))
#endif
) {
c = str + len - 1;
while (*c == '/'
-#if PHP_WIN32
+#ifdef PHP_WIN32
|| *c == '\\'
#endif
)
c--; /* strip trailing slashes */
*(c + 1) = '\0';
if ((c = strrchr(str, '/'))
-#if PHP_WIN32
+#ifdef PHP_WIN32
|| (c = strrchr(str, '\\'))
#endif
)
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/syslog.h"
#else
#include <syslog.h>
/* AIX doesn't have LOG_AUTHPRIV */
REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | CONST_PERSISTENT);
#endif
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT);
/* AIX doesn't have LOG_AUTHPRIV */
SET_VAR_LONG("LOG_AUTHPRIV", LOG_AUTHPRIV);
#endif
-#if !PHP_WIN32
+#if !defined(PHP_WIN32)
SET_VAR_LONG("LOG_LOCAL0", LOG_LOCAL0);
SET_VAR_LONG("LOG_LOCAL1", LOG_LOCAL1);
SET_VAR_LONG("LOG_LOCAL2", LOG_LOCAL2);
#include <errno.h>
#include <stdio.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/time.h"
#else
#include <sys/time.h>
php_error(E_WARNING, "The prefix to uniqid should not be more than 114 characters.");
return;
}
-#if HAVE_USLEEP && !(PHP_WIN32)
+#if HAVE_USLEEP && !defined(PHP_WIN32)
if (!MORE_ENTROPY) {
usleep(1);
}
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <windows.h>
#include <winsock.h>
#define O_RDONLY _O_RDONLY
#include "php_zlib.h"
#include "fopen-wrappers.h"
#if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#endif
#include "snprintf.h"
#if HAVE_ZLIB
-#if defined(HAVE_UNISTD_H) && PHP_WIN32
+#if defined(HAVE_UNISTD_H) && defined(PHP_WIN32)
#undef HAVE_UNISTD_H
#endif
}
/* Absolute path open - prepend document_root in safe mode */
-#if PHP_WIN32
+#ifdef PHP_WIN32
if ((*filename == '\\')||(*filename == '/')||(filename[1] == ':')) {
#else
if (*filename == '/') {
ptr = pathbuf;
while (ptr && *ptr) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
end = strchr(ptr, ';');
#else
end = strchr(ptr, ':');
#include "rfc1867.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
#define STRCASECMP stricmp
#else
#define STRCASECMP strcasecmp
#define SAPI_POST_BLOCK_SIZE 4000
-#if PHP_WIN32
+#ifdef PHP_WIN32
# ifdef SAPI_EXPORTS
# define SAPI_API __declspec(dllexport)
# else
if (!env_location) {
env_location="";
}
-#if PHP_WIN32
+#ifdef PHP_WIN32
{
if (php_ini_path) {
default_location = php_ini_path;
php_ini_search_path = (char *) malloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1);
if (!php_ini_path) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
sprintf(php_ini_search_path,".;%s;%s",env_location,default_location);
#else
sprintf(php_ini_search_path,".:%s:%s",env_location,default_location);
PG(open_basedir) = open_basedir;
if (!cfgin) {
-# if PHP_WIN32
+# ifdef PHP_WIN32
return FAILURE;
# else
return SUCCESS; /* having no configuration file is ok */
#include <sys/stat.h>
#include <fcntl.h>
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <windows.h>
#include <winsock.h>
#define O_RDONLY _O_RDONLY
#include "zend_compile.h"
#if HAVE_PWD_H
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG)
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <winsock.h>
#else
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
#undef AF_UNIX
#endif
/* Strip filename */
while ((
-#if PHP_WIN32
+#ifdef PHP_WIN32
(local_open_basedir[local_open_basedir_pos] != '\\') ||
#endif
(local_open_basedir[local_open_basedir_pos] != '/')
/* Resolve the real path into resolved_name */
if ((php_realpath(path, resolved_name) != NULL) && (php_realpath(local_open_basedir, resolved_basedir) != NULL)) {
/* Check the path */
-#if PHP_WIN32
+#ifdef PHP_WIN32
if (strncasecmp(resolved_basedir, resolved_name, strlen(resolved_basedir)) == 0) {
#else
if (strncmp(resolved_basedir, resolved_name, strlen(resolved_basedir)) == 0) {
ptr = pathbuf;
while (ptr && *ptr) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
end = strchr(ptr, ';');
#else
end = strchr(ptr, ':');
return fp;
}
/* Absolute path open - prepend document_root in safe mode */
-#if PHP_WIN32
+#ifdef PHP_WIN32
if ((*filename == '\\') || (*filename == '/') || (filename[1] == ':')) {
#else
if (*filename == '/') {
ptr = pathbuf;
while (ptr && *ptr) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
end = strchr(ptr, ';');
#else
end = strchr(ptr, ':');
#define USE_PATH 1
#define IGNORE_URL 2
/* There's no USE_URL. */
-#if PHP_WIN32
+#ifdef PHP_WIN32
# define IGNORE_URL_WIN 2
#else
# define IGNORE_URL_WIN 0
#endif
#define ENFORCE_SAFE_MODE 4
-#if PHP_WIN32
+#ifdef PHP_WIN32
# define SOCK_ERR INVALID_SOCKET
# define SOCK_CONN_ERR SOCKET_ERROR
# define SOCK_RECV_ERR SOCKET_ERROR
#include <stdio.h>
#include "php.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
#include "ext/standard/php_standard.h"
#include "snprintf.h"
#include "php_variables.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include <io.h>
#include <fcntl.h>
#include "win32/syslog.h"
static void php_set_timeout(long seconds)
{
-#if PHP_WIN32
+#ifdef PHP_WIN32
#else
# ifdef HAVE_SETITIMER
struct itimerval t_r; /* timeout requested */
static void php_unset_timeout(void)
{
-#if PHP_WIN32
+#ifdef PHP_WIN32
#else
# ifdef HAVE_SETITIMER
struct itimerval no_timeout;
snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":""));
}
-# if PHP_WIN32
+# if defined(PHP_WIN32)
OutputDebugString(memory_leak_buf);
# else
fprintf(stderr, memory_leak_buf);
php_core_globals *core_globals;
sapi_globals_struct *sapi_globals = ts_resource(sapi_globals_id);
#endif
-#if (PHP_WIN32) && !(USE_SAPI)
+#ifdef PHP_WIN32
WORD wVersionRequested = MAKEWORD(2, 0);
WSADATA wsaData;
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
{
DWORD dwVersion = GetVersion();
setlocale(LC_CTYPE, "");
#endif
-#if (PHP_WIN32) && !(USE_SAPI)
+#ifdef PHP_WIN32
/* start up winsock services */
if (WSAStartup(wVersionRequested, &wsaData) != 0) {
php_printf("\nwinsock.dll unusable. %d\n", WSAGetLastError());
/* close down the ini config */
php_config_ini_shutdown();
-#if (PHP_WIN32)
+#ifdef PHP_WIN32
/*close winsock */
WSACleanup();
#endif
return;
}
-#if PHP_WIN32
+#ifdef PHP_WIN32
UpdateIniFromRegistry(primary_file->filename);
#endif
}
}
-#if PHP_WIN32
+#ifdef PHP_WIN32
/* just so that this symbol gets exported... */
PHPAPI void dummy_indent()
{
#include "php.h"
-#if (PHP_WIN32)
+#ifdef PHP_WIN32
#include <winsock.h> /* Includes definition for u_char */
#endif
#include "php_version.h"
#include "zend.h"
-#define PHP_WIN32 ZEND_WIN32
-
/* automake defines PACKAGE and VERSION for Zend too */
#ifdef PACKAGE
# undef PACKAGE
*/
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "config.w32.h"
#include "win95nt.h"
# ifdef PHP_EXPORTS
#define DEBUG ZEND_DEBUG
-#if DEBUG || !(defined(__GNUC__)||PHP_WIN32)
+#if DEBUG || !(defined(__GNUC__)||defined(PHP_WIN32))
#ifdef inline
#undef inline
#endif
#endif
#if HAVE_PWD_H
-# if PHP_WIN32
+# ifdef PHP_WIN32
#include "win32/pwd.h"
#include "win32/param.h"
# else
/* global variables */
extern pval *data;
-#if !(PHP_WIN32)
+#if !defined(PHP_WIN32)
extern char **environ;
#define php_sleep sleep
#endif
char path_copy[MAXPATHLEN]; /* A work-copy of the path */
char *workpos; /* working position in *path */
-#if !(PHP_WIN32)
+#if !defined(PHP_WIN32)
char buf[MAXPATHLEN]; /* Buffer for readlink */
int linklength; /* The result from readlink */
#endif
struct stat filestat; /* result from stat */
-#if PHP_WIN32
+#ifdef PHP_WIN32
char *temppos; /* position while counting '.' */
int dotcount; /* number of '.' */
int t; /* counter */
strcpy(path_copy, path);
workpos = path_copy;
-#if PHP_WIN32
+#ifdef PHP_WIN32
/* Find out where we start - Windows version */
if ((*workpos == '\\') || (*workpos == '/')) {
/* We start at the root of the current drive */
/* Go to the end, then stop */
while(*workpos != 0) {
/* Strip (back)slashes */
-#if PHP_WIN32
+#ifdef PHP_WIN32
while(*workpos == '\\') workpos++;
#else
while(*workpos == '/') workpos++;
#endif
-#if PHP_WIN32
+#ifdef PHP_WIN32
/* reset dotcount */
dotcount = 0;
*writepos++ = *workpos++;
}
*writepos = 0;
-#else /* PHP_WIN32 */
+#else /* defined(PHP_WIN32) */
/* Look for .. */
if ((workpos[0] == '.') && (workpos[1] != 0)) {
if ((workpos[1] == '.') && ((workpos[2] == '/') || (workpos[2] == 0))) {
*writepos++ = *workpos++;
}
*writepos = 0;
-#endif /* PHP_WIN32 */
+#endif /* defined(PHP_WIN32) */
}
/* Check if the resolved path is a directory */
#include <stdio.h>
#include "php.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
if (!script_filename) {
script_filename = SG(request_info).argv0;
}
-#if PHP_WIN32
+#ifdef PHP_WIN32
/* FIXME WHEN APACHE NT IS FIXED */
/* a hack for apache nt because it does not appear to set argv[1] and sets
script filename to php.exe thus makes us parse php.exe instead of file.php