Skip to content

Don't include system headers in php_config.h #17124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions TSRM/TSRM.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,27 @@
#if !defined(__CYGWIN__) && defined(_WIN32)
# define TSRM_WIN32
# include <Zend/zend_config.w32.h>
# define _CRTDBG_MAP_ALLOC
# include <malloc.h>
# include <stdlib.h>
# include <crtdbg.h>
# include <string.h>
# ifndef ZEND_INCLUDE_FULL_WINDOWS_HEADERS
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
# include <windows.h>
# include <float.h>
#else
# include <main/php_config.h>
# include <stdlib.h>
# ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
# ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
# endif
# include <string.h>
#endif

#include <stdint.h>
Expand Down
26 changes: 26 additions & 0 deletions Zend/zend.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,32 @@

#define ZEND_ENGINE_3

#if !defined(__CYGWIN__) && defined(_WIN32)
# define TSRM_WIN32
# include <Zend/zend_config.w32.h>
# define _CRTDBG_MAP_ALLOC
# include <malloc.h>
# include <stdlib.h>
# include <crtdbg.h>
# include <string.h>
# ifndef ZEND_INCLUDE_FULL_WINDOWS_HEADERS
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
# include <windows.h>
# include <float.h>
#else
# include <main/php_config.h>
# include <stdlib.h>
# ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
# ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
# endif
# include <string.h>
#endif

#include "zend_types.h"
#include "zend_map_ptr.h"
#include "zend_errors.h"
Expand Down
16 changes: 0 additions & 16 deletions Zend/zend_config.w32.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@

#include <../main/config.w32.h>

#define _CRTDBG_MAP_ALLOC

#include <malloc.h>
#include <stdlib.h>
#include <crtdbg.h>

#include <string.h>

#ifndef ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#include <windows.h>

#include <float.h>

#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
Expand Down
12 changes: 0 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ AH_TOP([
#define ZEND_DLIMPORT
])
AH_BOTTOM([
#include <stdlib.h>

#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

#include <string.h>

#endif /* PHP_CONFIG_H */
])

Expand Down
1 change: 1 addition & 0 deletions sapi/fpm/fpm/fpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#ifndef FPM_H
#define FPM_H 1

#include <zend.h>
#include <unistd.h>

#ifdef HAVE_SYSEXITS_H
Expand Down
2 changes: 2 additions & 0 deletions sapi/fpm/fpm/fpm_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#ifndef FPM_EVENTS_H
#define FPM_EVENTS_H 1

#include <zend.h>

#define FPM_EV_TIMEOUT (1 << 0)
#define FPM_EV_READ (1 << 1)
#define FPM_EV_PERSIST (1 << 2)
Expand Down
Loading