summaryrefslogtreecommitdiff
path: root/ext/recode
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2000-06-06 14:13:35 +0000
committerThies C. Arntzen <thies@php.net>2000-06-06 14:13:35 +0000
commit11fabacc3c998456e334be142d558a0f0274bc65 (patch)
tree64d35e2dab7f3ad88f6aa73e5664f473e1a879b2 /ext/recode
parent0e0f3eb0978b9a181a43363cbb251d02c05c2cc7 (diff)
downloadphp-git-11fabacc3c998456e334be142d558a0f0274bc65.tar.gz
add check for stdbool.h
Diffstat (limited to 'ext/recode')
-rw-r--r--ext/recode/config.m43
-rw-r--r--ext/recode/php_recode.h7
-rw-r--r--ext/recode/recode.c3
3 files changed, 11 insertions, 2 deletions
diff --git a/ext/recode/config.m4 b/ext/recode/config.m4
index 80ba17f868..83b0b5b193 100644
--- a/ext/recode/config.m4
+++ b/ext/recode/config.m4
@@ -58,5 +58,8 @@ recode_format_table();
fi
AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher])
+
+ AC_CHECK_HEADERS(stdbool.h)
+
PHP_EXTENSION(recode,$ext_shared)
fi
diff --git a/ext/recode/php_recode.h b/ext/recode/php_recode.h
index 6f506de696..e20494087b 100644
--- a/ext/recode/php_recode.h
+++ b/ext/recode/php_recode.h
@@ -45,7 +45,12 @@
*/
#define HAVE_BROKEN_RECODE
-#include <stdbool.h>
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+ typedef enum {false = 0, true = 1} bool;
+#endif
+
#include <sys/types.h>
#include <stdio.h>
#include <recode.h>
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index 5b63d37a51..e1ed131ec4 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -29,6 +29,7 @@
#include "ext/standard/php_string.h"
#include "zend_list.h"
+
#ifdef HAVE_BROKEN_RECODE
extern char *program_name;
char *program_name = "php";
@@ -110,7 +111,7 @@ PHP_FUNCTION(recode_string)
char *r = NULL;
pval **str;
pval **req;
- int success;
+ bool success;
ReSLS_FETCH();
if (ZEND_NUM_ARGS() != 2