summaryrefslogtreecommitdiff
path: root/ext/pcre/pcrelib/pcre_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcre/pcrelib/pcre_config.c')
-rw-r--r--ext/pcre/pcrelib/pcre_config.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/ext/pcre/pcrelib/pcre_config.c b/ext/pcre/pcrelib/pcre_config.c
index 34719591f..3d5689f62 100644
--- a/ext/pcre/pcrelib/pcre_config.c
+++ b/ext/pcre/pcrelib/pcre_config.c
@@ -41,7 +41,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* This module contains the external function pcre_config(). */
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
/* Keep the original link size. */
static int real_link_size = LINK_SIZE;
@@ -63,18 +65,21 @@ Arguments:
Returns: 0 if data returned, negative on error
*/
-#ifdef COMPILE_PCRE8
+#if defined COMPILE_PCRE8
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
pcre_config(int what, void *where)
-#else
+#elif defined COMPILE_PCRE16
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
pcre16_config(int what, void *where)
+#elif defined COMPILE_PCRE32
+PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
+pcre32_config(int what, void *where)
#endif
{
switch (what)
{
case PCRE_CONFIG_UTF8:
-#if defined COMPILE_PCRE16
+#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
*((int *)where) = 0;
return PCRE_ERROR_BADOPTION;
#else
@@ -87,7 +92,20 @@ switch (what)
#endif
case PCRE_CONFIG_UTF16:
-#if defined COMPILE_PCRE8
+#if defined COMPILE_PCRE8 || defined COMPILE_PCRE32
+ *((int *)where) = 0;
+ return PCRE_ERROR_BADOPTION;
+#else
+#if defined SUPPORT_UTF
+ *((int *)where) = 1;
+#else
+ *((int *)where) = 0;
+#endif
+ break;
+#endif
+
+ case PCRE_CONFIG_UTF32:
+#if defined COMPILE_PCRE8 || defined COMPILE_PCRE16
*((int *)where) = 0;
return PCRE_ERROR_BADOPTION;
#else