Skip to content

Commit

Permalink
- Don't define DEBUG anymore. Everyone should use PHP_DEBUG.
Browse files Browse the repository at this point in the history
  There are 2-3 third-party libs in PHP which use DEBUG and I left them
  this way (primary example is pcrelib).
- Please test things and Andrei, can you check that pcrelib stopped
  printing the warning messages?
  • Loading branch information
Andi Gutmans committed Mar 11, 2000
1 parent fe55809 commit 9dca788
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion build-defs.h.in
Expand Up @@ -39,7 +39,7 @@
#define PHP_BINNAME "@BINNAME@"
#define PHP_CFLAGS "@CFLAGS@"
#define PHP_DBASE_LIB ""
#define PHP_DEBUG "@DEBUG_CFLAGS@"
#define PHP_BUILD_DEBUG "@DEBUG_CFLAGS@"
#define PHP_GDBM_INCLUDE ""
#define PHP_HSREGEX ""
#define PHP_IBASE_INCLUDE ""
Expand Down
2 changes: 0 additions & 2 deletions configure.in
Expand Up @@ -406,11 +406,9 @@ AC_MSG_CHECKING(whether to include debugging symbols)
AC_MSG_RESULT($PHP_DEBUG)
if test "$PHP_DEBUG" = "yes"; then
AC_DEFINE(DEBUG,1)
PHP_DEBUG=1
ZEND_DEBUG=yes
else
AC_DEFINE(DEBUG,0)
PHP_DEBUG=0
ZEND_DEBUG=no
fi
Expand Down
2 changes: 1 addition & 1 deletion ext/cybercash/cybercash.h
Expand Up @@ -35,7 +35,7 @@

#if PHP_API_VERSION < 19990421
#define zend_module_entry cybercash_module_entry
#include "modules.h"
#include "zend_modules.h"
#include "internal_functions.h"
#endif

Expand Down
4 changes: 2 additions & 2 deletions ext/db/db.c
Expand Up @@ -373,13 +373,13 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
ret = -1;
#else
#if NDBM
#if DEBUG
#if PHP_DEBUG
php_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n",filename,errno,strerror(errno));
#endif
if (errno) ret=errno;
else ret = -1;
#else
#if DEBUG
#if PHP_DEBUG
php_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n",filename,errno,strerror(errno));
#endif
if (errno) ret=errno;
Expand Down
8 changes: 4 additions & 4 deletions ext/dbase/dbf_ndx.c
Expand Up @@ -50,7 +50,7 @@ static ndx_page_t *ndx_get_page(ndx_header_t *hp, int pageno)
dndx_page_t *dp;
ndx_record_t *rp;

#if DEBUG
#if PHP_DEBUG
printf("getting page %d", pageno);
#endif
if ((fp = (ndx_page_t *)malloc(sizeof(ndx_page_t))) == NULL)
Expand All @@ -75,7 +75,7 @@ static ndx_page_t *ndx_get_page(ndx_header_t *hp, int pageno)
memset(rp, 0, sizeof(ndx_record_t) * hp->ndx_keys_ppg);
fp->ndxp_records = rp;
fp->ndxp_header_p = hp;
#if DEBUG
#if PHP_DEBUG
printf(", n_keys %ld\n", fp->ndxp_num_keys);
#endif
return fp;
Expand All @@ -102,7 +102,7 @@ static ndx_record_t *ndx_get_record(ndx_page_t *fp, int rec_no)
ndx_header_t *hp = fp->ndxp_header_p;
struct dndx_record *drp;

#if DEBUG
#if PHP_DEBUG
printf("page %ld, rec %d: ", fp->ndxp_page_no, rec_no);
#endif
if (rec_no >= fp->ndxp_num_keys)
Expand All @@ -117,7 +117,7 @@ static ndx_record_t *ndx_get_record(ndx_page_t *fp, int rec_no)
rp->ndxr_key_data = &drp->dndx_key_data;
rp->ndxr_p_nrec = rec_no;
}
#if DEBUG
#if PHP_DEBUG
printf("left %ld, dbf_rec %ld, data '%s'\n", rp->ndxr_left,
rp->ndxr_rec, rp->ndxr_key_data);
#endif
Expand Down
2 changes: 1 addition & 1 deletion ext/gettext/php_gettext.h
Expand Up @@ -34,7 +34,7 @@

#if HAVE_LIBINTL
#ifndef INIT_FUNC_ARGS
#include "modules.h"
#include "zend_modules.h"
#endif

extern zend_module_entry php_gettext_module_entry;
Expand Down
2 changes: 1 addition & 1 deletion ext/icap/php_icap.c
Expand Up @@ -49,7 +49,7 @@
#include <stdarg.h>
#include "cal.h"
#include "php_icap.h"
#include "modules.h"
#include "zend_modules.h"
#if (WIN32|WINNT)
#include "winsock.h"
#endif
Expand Down
8 changes: 4 additions & 4 deletions ext/imap/imap.c
Expand Up @@ -46,7 +46,7 @@
#include "imap.h"
#include "mail.h"
#include "rfc822.h"
#include "modules.h"
#include "zend_modules.h"
#if (WIN32|WINNT)
#include "winsock.h"
MAILSTREAM DEFAULTPROTO;
Expand Down Expand Up @@ -459,7 +459,7 @@ PHP_MINIT_FUNCTION(imap)

/* Open Options */

REGISTER_MAIN_LONG_CONSTANT("OP_DEBUG", OP_DEBUG, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("OP_PHP_DEBUG", OP_PHP_DEBUG, CONST_PERSISTENT | CONST_CS);
/* debug protocol negotiations */

REGISTER_MAIN_LONG_CONSTANT("OP_READONLY", OP_READONLY, CONST_PERSISTENT | CONST_CS);
Expand Down Expand Up @@ -2349,7 +2349,7 @@ PHP_FUNCTION(imap_utf7_decode)

*outp = 0;

#if DEBUG
#if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
php_error(E_WARNING,
Expand Down Expand Up @@ -2476,7 +2476,7 @@ PHP_FUNCTION(imap_utf7_encode)

*outp = 0;

#if DEBUG
#if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
php_error(E_WARNING,
Expand Down
2 changes: 1 addition & 1 deletion ext/mcal/php_mcal.c
Expand Up @@ -49,7 +49,7 @@
#include <stdarg.h>
#include "mcal.h"
#include "php_mcal.h"
#include "modules.h"
#include "zend_modules.h"
#if (WIN32|WINNT)
#include "winsock.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion ext/mcrypt/php_mcrypt.h
Expand Up @@ -5,7 +5,7 @@

#if PHP_API_VERSION < 19990421
#define zend_module_entry zend_module_entry
#include "modules.h"
#include "zend_modules.h"
#include "internal_functions.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion ext/mhash/php_mhash.h
Expand Up @@ -5,7 +5,7 @@

#if PHP_API_VERSION < 19990421
#define zend_module_entry zend_module_entry
#include "modules.h"
#include "zend_modules.h"
#include "internal_functions.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion ext/odbc/php_odbc.c
Expand Up @@ -243,7 +243,7 @@ static PHP_INI_DISP(display_defPW)
}

if (value) {
#if DEBUG
#if PHP_DEBUG
php_printf("%s", value);
#else
PUTS("********");
Expand Down
8 changes: 4 additions & 4 deletions ext/standard/dns.c
Expand Up @@ -75,14 +75,14 @@ char *php_gethostbyaddr(char *ip)
struct hostent *hp;

if ((int) (addr = inet_addr(ip)) == -1) {
#if DEBUG
#if PHP_DEBUG
php_error(E_WARNING, "address not in a.b.c.d form");
#endif
return estrdup(ip);
}
hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET);
if (!hp) {
#if DEBUG
#if PHP_DEBUG
php_error(E_WARNING, "Unable to resolve %s\n", ip);
#endif
return estrdup(ip);
Expand Down Expand Up @@ -127,7 +127,7 @@ PHP_FUNCTION(gethostbynamel)

hp = gethostbyname((*arg)->value.str.val);
if (hp == NULL || hp->h_addr_list == NULL) {
#if DEBUG
#if PHP_DEBUG
php_error(E_WARNING, "Unable to resolve %s\n", (*arg)->value.str.val);
#endif
return;
Expand All @@ -149,7 +149,7 @@ char *php_gethostbyname(char *name)

hp = gethostbyname(name);
if (!hp || !hp->h_addr_list) {
#if DEBUG
#if PHP_DEBUG
php_error(E_WARNING, "Unable to resolve %s\n", name);
#endif
return estrdup(name);
Expand Down
6 changes: 3 additions & 3 deletions main/php.h
Expand Up @@ -73,11 +73,11 @@ extern unsigned char second_arg_allow_ref[];
#include "php_regex.h"

/* PHP's DEBUG value must match Zend's ZEND_DEBUG value */
#undef DEBUG
#define DEBUG ZEND_DEBUG
#undef PHP_DEBUG
#define PHP_DEBUG ZEND_DEBUG


#if DEBUG || !(defined(__GNUC__)||defined(PHP_WIN32))
#if PHP_DEBUG || !(defined(__GNUC__)||defined(PHP_WIN32))
#ifdef inline
#undef inline
#endif
Expand Down
2 changes: 1 addition & 1 deletion main/win95nt.h
Expand Up @@ -44,7 +44,7 @@ typedef long pid_t;
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.78539816339744830962

#if !DEBUG
#if !PHP_DEBUG
#ifdef inline
#undef inline
#endif
Expand Down

0 comments on commit 9dca788

Please sign in to comment.