Skip to content

Commit

Permalink
centralize #include "build-defs.h" and drop (sometimes inconsistent) …
Browse files Browse the repository at this point in the history
…other

instances
  • Loading branch information
Sascha Schumann committed Oct 24, 2002
1 parent 26617f8 commit 2909e5c
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 71 deletions.
3 changes: 3 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ limits.h \
locale.h \
monetary.h \
mach-o/dyld.h \
netdb.h \
pwd.h \
resolv.h \
signal.h \
Expand Down Expand Up @@ -1108,6 +1109,8 @@ PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend)
PHP_GEN_BUILD_DIRS
PHP_GEN_GLOBAL_MAKEFILE

AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ])

$php_shtool mkdir -p pear/scripts
ALL_OUTPUT_FILES="php4.spec main/build-defs.h \
pear/scripts/phpize pear/scripts/php-config \
Expand Down
2 changes: 1 addition & 1 deletion ext/dbase/dbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ zend_module_entry dbase_module_entry = {
#ifdef COMPILE_DL_DBASE
ZEND_GET_MODULE(dbase)

#if (WIN32|WINNT) && defined(THREAD_SAFE)
#if defined(PHP_WIN32) && defined(THREAD_SAFE)

/*NOTE: You should have an odbc.def file where you
export DllMain*/
Expand Down
4 changes: 2 additions & 2 deletions ext/dotnet/php_dotnet.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PHP_DOTNET_H
#define PHP_DOTNET_H

#if WIN32|WINNT
#ifdef PHP_WIN32

PHP_MINIT_FUNCTION(DOTNET);
PHP_MSHUTDOWN_FUNCTION(DOTNET);
Expand All @@ -14,7 +14,7 @@ extern zend_module_entry DOTNET_module_entry;

#define DOTNET_module_ptr NULL

#endif /* Win32|WINNT */
#endif /* PHP_WIN32 */

#define phpext_DOTNET_ptr DOTNET_module_ptr

Expand Down
2 changes: 1 addition & 1 deletion ext/ereg/regex/regex_extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX))

#if !(WIN32|WINNT)
#ifndef PHP_WIN32

#ifndef PHP_NO_ALIASES

Expand Down
3 changes: 1 addition & 2 deletions ext/fbsql/php_fbsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"

#if WIN32|WINNT
#ifdef PHP_WIN32
#include <winsock.h>
#else
#include <php_config.h>
#include <build-defs.h>

#if HAVE_SYS_TYPES_H
#include <sys/types.h>
Expand Down
2 changes: 1 addition & 1 deletion ext/filepro/filepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ zend_module_entry filepro_module_entry = {

#ifdef COMPILE_DL_FILEPRO
ZEND_GET_MODULE(filepro)
#if (WIN32|WINNT) && defined(THREAD_SAFE)
#if defined(PHP_WIN32) && defined(THREAD_SAFE)

/*NOTE: You should have an odbc.def file where you
export DllMain*/
Expand Down
2 changes: 1 addition & 1 deletion ext/gd/gdcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/

/* This just seems unessacary */
#if (WIN32|WINNT)
#if PHP_WIN32
#define ENABLE_GD_TTF
#else
#include "php_config.h"
Expand Down
8 changes: 4 additions & 4 deletions ext/hwapi/hwapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ extern "C"
{
#include "php.h"
#include "php_globals.h"
//#include "ext/standard/php_standard.h"
#include "ext/standard/head.h"
#include "ext/standard/info.h"
//#include "fopen-wrappers.h"
#if 0
#include "ext/standard/php_standard.h"
#include "fopen-wrappers.h"
#endif
#include "SAPI.h"
}

#ifdef PHP_WIN32
#include <winsock.h>
#else
#include "build-defs.h"
#endif
#ifdef HAVE_MMAP
#include <sys/mman.h>
Expand Down
2 changes: 0 additions & 2 deletions ext/hyperwave/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

#ifdef PHP_WIN32
#include <winsock.h>
#else
#include "build-defs.h"
#endif

#if HYPERWAVE
Expand Down
4 changes: 0 additions & 4 deletions ext/imap/php_imap.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@

#if HAVE_IMAP

#ifndef PHP_WIN32
#include "build-defs.h"
#endif

#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
/* these are used for quota support */
# include "c-client.h" /* includes mail.h and rfc822.h */
Expand Down
8 changes: 6 additions & 2 deletions ext/informix/ifx.ec
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@

#ifdef PHP_WIN32
#include <winsock.h>
#else
#include "build-defs.h"
#endif

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

#if HAVE_NETDB_H
#include <netdb.h>
#endif

#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

Expand Down
4 changes: 0 additions & 4 deletions ext/mcal/php_mcal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

#if HAVE_MCAL

#ifndef PHP_WIN32
#include "build-defs.h"
#endif

/* Functions accessable to PHP */
extern zend_module_entry php_mcal_module_entry;
#define php_mcal_module_ptr &php_mcal_module_entry
Expand Down
1 change: 0 additions & 1 deletion ext/mysql/php_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
# include <sys/socket.h>
# define signal(a, b) NULL
#else
# include "build-defs.h"
# if HAVE_SIGNAL_H
# include <signal.h>
# endif
Expand Down
4 changes: 0 additions & 4 deletions ext/oci8/oci8.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ static zend_class_entry *oci_coll_class_entry_ptr;
} \
}

#ifndef PHP_WIN32
#include "build-defs.h"
#endif

#include <fcntl.h>

#ifndef O_BINARY
Expand Down
2 changes: 0 additions & 2 deletions ext/odbc/php_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#define ODBC_TYPE "Win32"
#define PHP_ODBC_TYPE ODBC_TYPE

#else
#include "build-defs.h"
#endif

/*
Expand Down
4 changes: 0 additions & 4 deletions ext/oracle/oracle.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
#define PHP_ORA_API
#endif

#ifndef PHP_WIN32
#include "build-defs.h"
#endif

#ifdef ZTS
int ora_globals_id;
#else
Expand Down
4 changes: 2 additions & 2 deletions ext/rpc/dotnet/php_dotnet.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PHP_DOTNET_H
#define PHP_DOTNET_H

#if WIN32|WINNT
#ifdef PHP_WIN32

PHP_MINIT_FUNCTION(DOTNET);
PHP_MSHUTDOWN_FUNCTION(DOTNET);
Expand All @@ -14,7 +14,7 @@ extern zend_module_entry DOTNET_module_entry;

#define DOTNET_module_ptr NULL

#endif /* Win32|WINNT */
#endif /* PHP_WIN32 */

#define phpext_DOTNET_ptr DOTNET_module_ptr

Expand Down
4 changes: 0 additions & 4 deletions ext/standard/dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#include "ext/standard/info.h"
#include "SAPI.h"

#if !defined(PHP_WIN32) && !defined(NETWARE)
#include "build-defs.h"
#endif

#if defined(HAVE_LIBDL) || HAVE_MACH_O_DYLD_H
#include <stdlib.h>
#include <stdio.h>
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/fsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ static int fsock_globals_id;
#ifdef USE_WINSOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
#else
#include "build-defs.h"
#endif

/* {{{ php_lookup_hostname */
Expand Down
3 changes: 0 additions & 3 deletions ext/standard/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
#include "SAPI.h"
#include <time.h>
#include "php_main.h"
#if !defined(PHP_WIN32) && !defined(NETWARE)
#include "build-defs.h"
#endif
#include "zend_globals.h" /* needs ELS */
#include "zend_extensions.h"
#ifdef HAVE_SYS_UTSNAME_H
Expand Down
5 changes: 2 additions & 3 deletions ext/standard/mail.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
#include <stdio.h>
#include "php.h"
#include "ext/standard/info.h"
#if !defined(PHP_WIN32) && !defined(NETWARE)
#include "build-defs.h"

#if HAVE_SYSEXITS_H
#include <sysexits.h>
#endif
#if HAVE_SYS_SYSEXITS_H
#include <sys/sysexits.h>
#endif
#endif

#include "php_mail.h"
#include "php_ini.h"
#include "safe_mode.h"
Expand Down
3 changes: 0 additions & 3 deletions ext/xml/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#if HAVE_LIBEXPAT

#if !defined(PHP_WIN32) && !defined(NETWARE)
# include "build-defs.h"
# endif
# include "ext/standard/head.h"

/* Short-term TODO list:
Expand Down
2 changes: 0 additions & 2 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#ifdef USE_WINSOCK
#include <novsock2.h>
#endif
#else
#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>
Expand Down
14 changes: 11 additions & 3 deletions main/php.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@
#endif

#ifdef NETWARE
#define PHP_UNAME "NetWare" /* For php_get_uname() function */
#define PHP_OS PHP_UNAME /* This is obtained using 'uname' on Unix and assigned in the case of Windows;
we'll do it this way atleast for now */
/* For php_get_uname() function */
#define PHP_UNAME "NetWare"
/*
* This is obtained using uname(2) on Unix and assigned in the case of Windows;
* we'll do it this way at least for now.
*/
#define PHP_OS PHP_UNAME
#endif

#include "php_regex.h"
Expand Down Expand Up @@ -92,6 +96,10 @@
#include <alloca.h>
#endif

#if HAVE_BUILD_DEFS_H
#include "build-defs.h"
#endif

/*
* This is a fast version of strlcpy which should be used, if you
* know the size of the destination buffer and if you know
Expand Down
3 changes: 0 additions & 3 deletions main/php_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#define INI_CHECK_CWD

#include "php.h"
#if !defined(PHP_WIN32) && !defined(NETWARE)
#include "build-defs.h"
#endif
#include "ext/standard/info.h"
#include "zend_ini.h"
#include "php_ini.h"
Expand Down
2 changes: 0 additions & 2 deletions main/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@

#ifdef PHP_WIN32
#define EWOULDBLOCK WSAEWOULDBLOCK
#else
#include "build-defs.h"
#endif

#define STREAM_DEBUG 0
Expand Down
2 changes: 1 addition & 1 deletion regex/regex_extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX))

#if !(WIN32|WINNT)
#ifndef PHP_WIN32

#ifndef PHP_NO_ALIASES

Expand Down
2 changes: 0 additions & 2 deletions sapi/apache/php_apache.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#if defined(PHP_WIN32) || defined(NETWARE)
#include "zend.h"
#include "ap_compat.h"
#else
#include "build-defs.h"
#endif

#ifdef ZTS
Expand Down
2 changes: 0 additions & 2 deletions sapi/cgi/cgi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
#else
#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>
Expand Down
2 changes: 0 additions & 2 deletions sapi/cli/php_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
#else
#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>
Expand Down
2 changes: 0 additions & 2 deletions sapi/servlet/servlet.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
#else
#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>
Expand Down

0 comments on commit 2909e5c

Please sign in to comment.