cvs: php4 / CODING_STANDARDS configure.in /main php.h
| From: | Yasuo Ohgaki | Date: | Thu, 14 Mar 2002 02:17:23 +0000 |
| Subject: | cvs: php4 / CODING_STANDARDS configure.in /main php.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10089@lists.php.net to get a copy of this message | ||
yohgaki Wed Mar 13 21:17:23 2002 EDT
Modified files:
/php4 configure.in CODING_STANDARDS
/php4/main php.h
Log:
Include/enable assert.h/assert() when it is available
Index: php4/configure.in
diff -u php4/configure.in:1.312 php4/configure.in:1.313
--- php4/configure.in:1.312 Wed Mar 13 07:30:48 2002
+++ php4/configure.in Wed Mar 13 21:17:22 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.312 2002/03/13 12:30:48 sas Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.313 2002/03/14 02:17:22 yohgaki Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -363,6 +363,7 @@
alloca.h \
arpa/inet.h \
arpa/nameser.h \
+assert.h \
crypt.h \
fcntl.h \
grp.h \
Index: php4/CODING_STANDARDS
diff -u php4/CODING_STANDARDS:1.10 php4/CODING_STANDARDS:1.11
--- php4/CODING_STANDARDS:1.10 Thu Feb 28 01:31:09 2002
+++ php4/CODING_STANDARDS Wed Mar 13 21:17:22 2002
@@ -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: php4/main/php.h
diff -u php4/main/php.h:1.159 php4/main/php.h:1.160
--- php4/main/php.h:1.159 Thu Feb 28 19:16:58 2002
+++ php4/main/php.h Wed Mar 13 21:17:23 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.159 2002/03/01 00:16:58 shane Exp $ */
+/* $Id: php.h,v 1.160 2002/03/14 02:17:23 yohgaki Exp $ */
#ifndef PHP_H
#define PHP_H
@@ -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(expr) ((void) (0))
+#endif /* HAVE_ASSERT_H */
#define APACHE 0