summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-03-11 20:48:49 +0000
committerAndi Gutmans <andi@php.net>2000-03-11 20:48:49 +0000
commit9dca788ca04cfe185c3faaab8ad0b872b1762977 (patch)
treedc2f471e5637593dfc07b457ff3300ef08388d22
parentfe558092e469f6307458cb0f3ae64ebcebf92b14 (diff)
downloadphp-git-9dca788ca04cfe185c3faaab8ad0b872b1762977.tar.gz
- Don't define DEBUG anymore. Everyone should use PHP_DEBUG.
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?
-rw-r--r--build-defs.h.in2
-rw-r--r--configure.in2
-rw-r--r--ext/cybercash/cybercash.h2
-rw-r--r--ext/db/db.c4
-rw-r--r--ext/dbase/dbf_ndx.c8
-rw-r--r--ext/gettext/php_gettext.h2
-rw-r--r--ext/icap/php_icap.c2
-rw-r--r--ext/imap/imap.c8
-rw-r--r--ext/mcal/php_mcal.c2
-rw-r--r--ext/mcrypt/php_mcrypt.h2
-rw-r--r--ext/mhash/php_mhash.h2
-rw-r--r--ext/odbc/php_odbc.c2
-rw-r--r--ext/standard/dns.c8
-rw-r--r--main/php.h6
-rw-r--r--main/win95nt.h2
15 files changed, 26 insertions, 28 deletions
diff --git a/build-defs.h.in b/build-defs.h.in
index fd9f697597..cd6f2260e2 100644
--- a/build-defs.h.in
+++ b/build-defs.h.in
@@ -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 ""
diff --git a/configure.in b/configure.in
index a7691b8113..366d4afdb7 100644
--- a/configure.in
+++ b/configure.in
@@ -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
diff --git a/ext/cybercash/cybercash.h b/ext/cybercash/cybercash.h
index 27bba3edd1..bbac201d8d 100644
--- a/ext/cybercash/cybercash.h
+++ b/ext/cybercash/cybercash.h
@@ -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
diff --git a/ext/db/db.c b/ext/db/db.c
index ea6b9e194f..ab1412d086 100644
--- a/ext/db/db.c
+++ b/ext/db/db.c
@@ -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;
diff --git a/ext/dbase/dbf_ndx.c b/ext/dbase/dbf_ndx.c
index 9263b02b0c..a648b42326 100644
--- a/ext/dbase/dbf_ndx.c
+++ b/ext/dbase/dbf_ndx.c
@@ -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)
@@ -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;
@@ -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)
@@ -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
diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h
index a6f156a0a8..800db28602 100644
--- a/ext/gettext/php_gettext.h
+++ b/ext/gettext/php_gettext.h
@@ -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;
diff --git a/ext/icap/php_icap.c b/ext/icap/php_icap.c
index 74d86a4be0..8de4171774 100644
--- a/ext/icap/php_icap.c
+++ b/ext/icap/php_icap.c
@@ -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
diff --git a/ext/imap/imap.c b/ext/imap/imap.c
index 539405695d..09637a0683 100644
--- a/ext/imap/imap.c
+++ b/ext/imap/imap.c
@@ -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;
@@ -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);
@@ -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,
@@ -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,
diff --git a/ext/mcal/php_mcal.c b/ext/mcal/php_mcal.c
index 4bc435e8ea..32ee72cad7 100644
--- a/ext/mcal/php_mcal.c
+++ b/ext/mcal/php_mcal.c
@@ -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
diff --git a/ext/mcrypt/php_mcrypt.h b/ext/mcrypt/php_mcrypt.h
index 87585ae2cc..ebbd57645d 100644
--- a/ext/mcrypt/php_mcrypt.h
+++ b/ext/mcrypt/php_mcrypt.h
@@ -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
diff --git a/ext/mhash/php_mhash.h b/ext/mhash/php_mhash.h
index 60f3955c18..58080fe1b2 100644
--- a/ext/mhash/php_mhash.h
+++ b/ext/mhash/php_mhash.h
@@ -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
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index c823d41882..2f2b173189 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -243,7 +243,7 @@ static PHP_INI_DISP(display_defPW)
}
if (value) {
-#if DEBUG
+#if PHP_DEBUG
php_printf("%s", value);
#else
PUTS("********");
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 6e63f37945..65ee1db015 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -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);
@@ -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;
@@ -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);
diff --git a/main/php.h b/main/php.h
index a667f6978a..cb332f28f4 100644
--- a/main/php.h
+++ b/main/php.h
@@ -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
diff --git a/main/win95nt.h b/main/win95nt.h
index 0e5413ab6f..9010c06e75 100644
--- a/main/win95nt.h
+++ b/main/win95nt.h
@@ -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