Hi all,

I made a patch to enable/include assert()/assert.h.
If you have comment, please let me know.

Thank you.

-- 
Yasuo Ohgaki
[EMAIL PROTECTED]
Index: configure.in
===================================================================
RCS file: /repository/php4/configure.in,v
retrieving revision 1.310
diff -u -r1.310 configure.in
--- configure.in        11 Mar 2002 13:17:41 -0000      1.310
+++ configure.in        12 Mar 2002 10:10:26 -0000
@@ -360,6 +360,7 @@
 alloca.h \
 arpa/inet.h \
 arpa/nameser.h \
+assert.h \
 crypt.h \
 fcntl.h \
 grp.h \
Index: CODING_STANDARDS
===================================================================
RCS file: /repository/php4/CODING_STANDARDS,v
retrieving revision 1.10
diff -u -r1.10 CODING_STANDARDS
--- CODING_STANDARDS    28 Feb 2002 06:31:09 -0000      1.10
+++ CODING_STANDARDS    12 Mar 2002 10:10:26 -0000
@@ -64,6 +64,9 @@
     not recommended. Since most of PHP_* macros are ZEND_* macro alias, use of
     PHP_* macro makes browsing source with tag search harder.
 
+[8] Use assert(). assert.h is included in php.h if it is available. 
+    Not only good assertion catch bugs, but also it makes easier to read code.
+
 Naming Conventions
 ------------------
 
Index: main/php.h
===================================================================
RCS file: /repository/php4/main/php.h,v
retrieving revision 1.159
diff -u -r1.159 php.h
--- main/php.h  1 Mar 2002 00:16:58 -0000       1.159
+++ main/php.h  12 Mar 2002 10:10:26 -0000
@@ -63,7 +63,16 @@
 
 #include "php_regex.h"
 
-
+#if HAVE_ASSERT_H
+#if PHP_DEBUG
+#undef NDEBUG
+#else
+#define NDEBUG
+#endif
+#include <assert.h>
+#else /* HAVE_ASSERT_H */
+#define assert()
+#endif /* HAVE_ASSERT_H */
 
 #define APACHE 0
 

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to