[Pcre-svn] [425] code/trunk: Lock out configuring for EBCDIC…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [425] code/trunk: Lock out configuring for EBCDIC with non-8-bit libraries.
Revision: 425
          http://www.exim.org/viewvc/pcre2?view=rev&revision=425
Author:   ph10
Date:     2015-11-11 17:43:37 +0000 (Wed, 11 Nov 2015)
Log Message:
-----------
Lock out configuring for EBCDIC with non-8-bit libraries.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/configure.ac
    code/trunk/src/pcre2_internal.h


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2015-11-11 09:42:26 UTC (rev 424)
+++ code/trunk/ChangeLog    2015-11-11 17:43:37 UTC (rev 425)
@@ -284,7 +284,9 @@


82. Small optimizations in code for finding the minimum matching length.

+83. Lock out configuring for EBCDIC with non-8-bit libraries.

+
Version 10.20 30-June-2015
--------------------------


Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac    2015-11-11 09:42:26 UTC (rev 424)
+++ code/trunk/configure.ac    2015-11-11 17:43:37 UTC (rev 425)
@@ -339,7 +339,8 @@
 # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.
 # Also check that UTF support is not requested, because PCRE2 cannot handle
 # EBCDIC and UTF in the same build. To do so it would need to use different
-# character constants depending on the mode.
+# character constants depending on the mode. Also, EBCDIC cannot be used with
+# 16-bit and 32-bit libraries.
 #
 if test "x$enable_ebcdic" = "xyes"; then
   enable_rebuild_chartables=yes
@@ -346,6 +347,9 @@
   if test "x$enable_unicode" = "xyes"; then
     AC_MSG_ERROR([support for EBCDIC and Unicode cannot be enabled at the same time])
   fi
+  if test "x$enable_pcre2_16" = "xyes" -o "x$enable_pcre2_32" = "xyes"; then
+    AC_MSG_ERROR([EBCDIC support is available only for the 8-bit library]) 
+  fi
 fi


# Check argument to --with-link-size

Modified: code/trunk/src/pcre2_internal.h
===================================================================
--- code/trunk/src/pcre2_internal.h    2015-11-11 09:42:26 UTC (rev 424)
+++ code/trunk/src/pcre2_internal.h    2015-11-11 17:43:37 UTC (rev 425)
@@ -39,7 +39,10 @@
 */


/* We do not support both EBCDIC and Unicode at the same time. The "configure"
-script prevents both being selected, but not everybody uses "configure". */
+script prevents both being selected, but not everybody uses "configure". EBCDIC
+is only supported for the 8-bit library, but the check for this has to be later
+in this file, because the first part is not width-dependent, and is included by
+pcre2test.c with CODE_UNIT_WIDTH == 0. */

#if defined EBCDIC && defined SUPPORT_UNICODE
#error The use of both EBCDIC and SUPPORT_UNICODE is not supported.
@@ -1803,11 +1806,16 @@

#if defined PCRE2_CODE_UNIT_WIDTH && PCRE2_CODE_UNIT_WIDTH != 0

+/* EBCDIC is supported only for the 8-bit library. */
+
+#if defined EBCDIC && PCRE2_CODE_UNIT_WIDTH != 8
+#error EBCDIC is not supported for the 16-bit or 32-bit libraries
+#endif
+
/* This is the largest non-UTF code point. */

#define MAX_NON_UTF_CHAR (0xffffffffU >> (32 - PCRE2_CODE_UNIT_WIDTH))

-
/* Internal shared data tables and variables. These are used by more than one
of the exported public functions. They have to be "external" in the C sense,
but are not part of the PCRE2 public API. Although the data for some of them is