Skip to content

Commit d4831e2

Browse files
committed
Eliminate win95nt.h
- Most of this is builtin php.h now - Removed some dead defines - We now pass /D _USE_MATH_DEFINES for M_PI etc
1 parent a569d00 commit d4831e2

File tree

5 files changed

+50
-85
lines changed

5 files changed

+50
-85
lines changed

ext/odbc/birdstep.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#if WIN32
3434
# include "config.w32.h"
35-
# include "win95nt.h"
3635
# ifdef PHP_EXPORTS
3736
# define PHPAPI __declspec(dllexport)
3837
# else

main/SAPI.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "zend_llist.h"
2828
#include "zend_operators.h"
2929
#ifdef PHP_WIN32
30-
#include "win95nt.h"
3130
#include "win32/php_stdint.h"
3231
#endif
3332
#include <sys/stat.h>

main/php.h

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747

4848
#ifdef PHP_WIN32
4949
# include "tsrm_win32.h"
50-
# include "win95nt.h"
5150
# ifdef PHP_EXPORTS
5251
# define PHPAPI __declspec(dllexport)
5352
# else
@@ -66,6 +65,53 @@
6665
# define PHP_EOL "\n"
6766
#endif
6867

68+
/* Windows specific defines */
69+
#ifdef PHP_WIN32
70+
# define PHP_PROG_SENDMAIL "Built in mailer"
71+
# define HAVE_DECLARED_TIMEZONE
72+
# define WIN32_LEAN_AND_MEAN
73+
# define NOOPENFILE
74+
75+
# include <io.h>
76+
# include <malloc.h>
77+
# include <direct.h>
78+
# include <stdlib.h>
79+
# include <stdio.h>
80+
# include <stdarg.h>
81+
# include <sys/types.h>
82+
# include <process.h>
83+
84+
typedef int uid_t;
85+
typedef int gid_t;
86+
typedef char * caddr_t;
87+
typedef unsigned int uint;
88+
typedef unsigned long ulong;
89+
# if !NSAPI
90+
typedef int pid_t;
91+
# endif
92+
93+
# ifndef PHP_DEBUG
94+
# ifdef inline
95+
# undef inline
96+
# endif
97+
# define inline __inline
98+
# endif
99+
100+
# define M_TWOPI (M_PI * 2.0)
101+
# define off_t _off_t
102+
103+
# define lstat(x, y) php_sys_lstat(x, y)
104+
# define chdir(path) _chdir(path)
105+
# define mkdir(a, b) _mkdir(a)
106+
# define rmdir(a) _rmdir(a)
107+
# define getpid _getpid
108+
# define php_sleep(t) SleepEx(t*1000, TRUE)
109+
110+
# ifndef getcwd
111+
# define getcwd(a, b) _getcwd(a, b)
112+
# endif
113+
#endif
114+
69115
#if HAVE_ASSERT_H
70116
#if PHP_DEBUG
71117
#undef NDEBUG

main/win95nt.h

Lines changed: 0 additions & 80 deletions
This file was deleted.

win32/build/confutils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,8 +3032,9 @@ function toolset_setup_common_cflags()
30323032
DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
30333033

30343034
// General CFLAGS for building objects
3035-
DEFINE("CFLAGS", "/nologo $(BASE_INCLUDES) /D _WINDOWS \
3036-
/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3");
3035+
DEFINE("CFLAGS", "/nologo $(BASE_INCLUDES) /D _WINDOWS /D WINDOWS=1 \
3036+
/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 \
3037+
/D _USE_MATH_DEFINES");
30373038

30383039
if (VS_TOOLSET) {
30393040
ADD_FLAG("CFLAGS", " /FD ");

0 commit comments

Comments
 (0)