#else
#include <strings.h>
#endif
-#if WIN32|WINNT
+#if PHP_WIN32
#include "win32/unistd.h"
#endif
#include "zend_globals.h"
#include <locale.h>
#endif
#include "safe_mode.h"
-#if WIN32|WINNT
+#if PHP_WIN32
#include "win32/unistd.h"
#endif
#include "zend_globals.h"
PHP_FE(gethostbyaddr, NULL)
PHP_FE(gethostbyname, NULL)
PHP_FE(gethostbynamel, NULL)
-#if !(WIN32|WINNT)||HAVE_BINDLIB
+#if !(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 MSVC5
+#if PHP_WIN32
typedef unsigned int php_stat_len;
#else
typedef int php_stat_len;
#include <strings.h>
#endif
-#if MSVC5
+#if PHP_WIN32
#include <process.h>
extern char *crypt(char *__key,char *__salt);
#endif
#include <errno.h>
-#if WIN32||WINNT
+#if PHP_WIN32
#define NEEDRDH 1
#include "win32/readdir.h"
#endif
#else
#include <strings.h>
#endif
-#if MSVC5
+#if PHP_WIN32
#include "win32/param.h"
#include "win32/winutil.h"
#else
} else {
error_type = E_CORE_ERROR;
}
-#if MSVC5
+#if 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 WIN32|WINNT
+#if PHP_WIN32
#if HAVE_BINDLIB
#ifndef WINNT
#define WINNT 1
return estrdup(inet_ntoa(in));
}
-#if !(WIN32|WINNT)||HAVE_BINDLIB
+#if !(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 !(WIN32|WINNT)||(HAVE_BINDLIB)
+#if !(PHP_WIN32)||(HAVE_BINDLIB)
PHP_FUNCTION(checkdnsrr);
PHP_FUNCTION(getmxrr);
#endif
tmp = php_escape_shell_cmd(d);
efree(d);
d = tmp;
-#if WIN32|WINNT
+#if PHP_WIN32
fp = popen(d, "rb");
#else
fp = popen(d, "r");
return -1;
}
} else { /* not safe_mode */
-#if WIN32|WINNT
+#if PHP_WIN32
fp = popen(cmd, "rb");
#else
fp = popen(cmd, "r");
}
convert_to_string_ex(cmd);
-#if WIN32|WINNT
+#if 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 MSVC5
+#if 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 MSVC5
+#if PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#if WIN32|WINNT
+#if PHP_WIN32
#include <winsock.h>
#else
#include <netinet/in.h>
int flags;
int myflag = 0;
-#if WIN32|WINNT
+#if 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 WIN32|WINNT
+#if 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 WIN32|WINNT
+#if 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 MSVC5
+# if PHP_WIN32
# include "win32/pwd.h"
# else
# include <pwd.h>
#endif
#if HAVE_GRP_H
-# if MSVC5
+# if PHP_WIN32
# include "win32/grp.h"
# else
# include <grp.h>
#endif
#if HAVE_UTIME
-# if MSVC5
+# if PHP_WIN32
# include <sys/utime.h>
# else
# include <utime.h>
#include <fcntl.h>
#endif
-#if WIN32|WINNT
+#if PHP_WIN32
#include <windows.h>
#include <io.h>
#endif
return ret;
}
-#elif WIN32|WINNT
+#elif 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 !(WIN32|WINNT)
+#if !(PHP_WIN32)
errno = EINVAL; /* bad call */
#endif
return -1;
int flock(int fd, int operation);
#endif
-#if WIN32|WINNT
+#if PHP_WIN32
# define fsync _commit
# define ftruncate chsize
-#endif /* WIN32|WINNT */
+#endif /* PHP_WIN32 */
#if !HAVE_INET_ATON
#if HAVE_NETINET_IN_H
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#ifdef WIN32
+#if PHP_WIN32
#include <winsock.h>
#else
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#endif
-#ifdef WIN32
+#if PHP_WIN32
#undef AF_UNIX
#endif
#if defined(AF_UNIX)
#define SEARCHCR() \
p = memchr(READPTR(sock), '\n', MIN(TOREAD(sock), maxlen));
-#if WIN32|WINNT
+#if 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 !defined(WIN32) && (defined(O_NONBLOCK) || defined(O_NDELAY))
+#if !PHP_WIN32 && (defined(O_NONBLOCK) || defined(O_NDELAY))
#ifndef O_NONBLOCK
#define O_NONBLOCK O_NDELAY
ret = -1;
}
return ret;
-#else /* !defined(WIN32) && ... */
+#else /* !PHP_WIN32 && ... */
return connect(sockfd, addr, addrlen);
#endif
}
return ret;
}
-#if !defined(WIN32) && !defined(WINNT)
+#if !PHP_WIN32
#undef closesocket
#define closesocket close
#endif
#ifndef _FSOCK_H
#define _FSOCK_H
-#if WIN32|WINNT
+#if PHP_WIN32
# ifndef WINNT
# define WINNT 1
# endif
#include "ext/standard/head.h"
#include "info.h"
#include "SAPI.h"
-#ifndef MSVC5
+#if !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 WIN32|WINNT
+#if PHP_WIN32
char php_windows_uname[256];
DWORD dwBuild=0;
DWORD dwVersion = GetVersion();
if (flag & PHP_INFO_GENERAL) {
-#if WIN32|WINNT
+#if 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 WIN32||WINNT
+#if PHP_WIN32
#include <process.h>
#endif
#include <sys/stat.h>
#include <string.h>
#if HAVE_PWD_H
-#if MSVC5
+#if PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#endif
#endif
#if HAVE_GRP_H
-#if MSVC5
+#if PHP_WIN32
#include "win32/grp.h"
#else
#include <grp.h>
#include <ctype.h>
#include <stdio.h>
#include "php.h"
-#ifndef MSVC5
+#if !PHP_WIN32
#include "build-defs.h"
#endif
#include "php_mail.h"
#include "php_ini.h"
#if HAVE_SENDMAIL
-#if MSVC5
+#if PHP_WIN32
#include "win32/sendmail.h"
#endif
int php_mail(char *to, char *subject, char *message, char *headers)
{
-#if MSVC5
+#if PHP_WIN32
int tsm_err;
#else
FILE *sendmail;
char *sendmail_path = INI_STR("sendmail_path");
#endif
-#if MSVC5
+#if 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 MSVC5
+#if 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 MSVC5
+#if PHP_WIN32
#include "win32/time.h"
#else
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#if MSVC5
+#if 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 MSVC5
+#if PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#if HAVE_PWD_H
-#if MSVC5
+#if PHP_WIN32
#include "win32/pwd.h"
#else
#include <pwd.h>
#include <unistd.h>
#endif
#include <sys/stat.h>
-#if MSVC5
+#if PHP_WIN32
#include <process.h>
#endif
#include "php.h"
-#if WIN32||WINNT
+#if PHP_WIN32
#include <malloc.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#ifdef WIN32
+#if PHP_WIN32
# include "win32/time.h"
#endif
ret = estrdup((*str)->value.str.val);
c = ret + (*str)->value.str.len -1;
while (*c == '/'
-#ifdef MSVC5
+#if PHP_WIN32
|| *c == '\\'
#endif
)
c--;
*(c + 1) = '\0';
if ((c = strrchr(ret, '/'))
-#ifdef MSVC5
+#if PHP_WIN32
|| (c = strrchr(ret, '\\'))
#endif
) {
c = str + len - 1;
while (*c == '/'
-#ifdef MSVC5
+#if PHP_WIN32
|| *c == '\\'
#endif
)
c--; /* strip trailing slashes */
*(c + 1) = '\0';
if ((c = strrchr(str, '/'))
-#ifdef MSVC5
+#if PHP_WIN32
|| (c = strrchr(str, '\\'))
#endif
)
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if MSVC5
+#if 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
-#ifndef MSVC5
+#if !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
-#ifndef MSVC5
+#if !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 MSVC5
+#if 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 && !(WIN32|WINNT)
+#if HAVE_USLEEP && !(PHP_WIN32)
if (!MORE_ENTROPY) {
usleep(1);
}