[Pcre-svn] [829] code/branches/pcre16: Change some preproces…

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [829] code/branches/pcre16: Change some preprocessor directives to support various configure modes
Revision: 829
          http://vcs.pcre.org/viewvc?view=rev&revision=829
Author:   zherczeg
Date:     2011-12-27 12:24:23 +0000 (Tue, 27 Dec 2011)


Log Message:
-----------
Change some preprocessor directives to support various configure modes

Modified Paths:
--------------
    code/branches/pcre16/pcre_tables.c
    code/branches/pcre16/pcretest.c


Modified: code/branches/pcre16/pcre_tables.c
===================================================================
--- code/branches/pcre16/pcre_tables.c    2011-12-27 11:25:32 UTC (rev 828)
+++ code/branches/pcre16/pcre_tables.c    2011-12-27 12:24:23 UTC (rev 829)
@@ -67,9 +67,10 @@
 /* These are the breakpoints for different numbers of bytes in a UTF-8
 character. */


-#ifdef SUPPORT_UTF
+#if (defined SUPPORT_UTF && defined COMPILE_PCRE8) \
+ || (defined PCRE_INCLUDED && defined SUPPORT_PCRE16)

-#ifdef COMPILE_PCRE8
+/* These tables are also required by pcretest in 16 bit mode. */

const int PRIV(utf8_table1)[] =
{ 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};
@@ -91,8 +92,10 @@
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };

-#endif /* COMPILE_PCRE8 */
+#endif /* (SUPPORT_UTF && COMPILE_PCRE8) || (PCRE_INCLUDED && SUPPORT_PCRE16)*/

+#ifdef SUPPORT_UTF
+
/* Table to translate from particular type value to the general value. */

const int PRIV(ucp_gentype)[] = {
@@ -119,7 +122,7 @@
ucp_Sc, ucp_So,
ucp_Zl, ucp_Zs,
};
-#endif
+#endif /* SUPPORT_JIT */

/* The pcre_utt[] table below translates Unicode property names into type and
code values. It is searched by binary chop, so must be in collating sequence of

Modified: code/branches/pcre16/pcretest.c
===================================================================
--- code/branches/pcre16/pcretest.c    2011-12-27 11:25:32 UTC (rev 828)
+++ code/branches/pcre16/pcretest.c    2011-12-27 12:24:23 UTC (rev 829)
@@ -160,6 +160,11 @@


#define PRINTOK(c) (locale_set? isprint(c) : PRINTABLE(c))

+/* Posix support is disabled in 16 bit only mode. */
+#if defined SUPPORT_PCRE16 && !defined SUPPORT_PCRE8 && !defined NOPOSIX
+#define NOPOSIX
+#endif
+
/* It is possible to compile this test program without including support for
testing the POSIX interface, though this is not available via the standard
Makefile. */
@@ -1028,7 +1033,7 @@
}


-#if !defined NOUTF
+#if !defined NOUTF || defined SUPPORT_PCRE16
 /*************************************************
 *            Convert UTF-8 string to value       *
 *************************************************/
@@ -1084,11 +1089,11 @@
 *vptr = d;
 return i+1;
 }
-#endif  /* NOUTF */
+#endif /* NOUTF || SUPPORT_PCRE16 */




-#if !defined NOUTF
+#if !defined NOUTF || defined SUPPORT_PCRE16
 /*************************************************
 *       Convert character value to UTF-8         *
 *************************************************/
@@ -1118,7 +1123,7 @@
 *utf8bytes = utf8_table2[i] | cvalue;
 return i + 1;
 }
-#endif
+#endif /* NOUTF || SUPPORT_PCRE16 */




@@ -3624,16 +3629,16 @@
           }
         continue;
         }
-        
+
       /* We now have a character value in c that may be greater than 255. In 
       16-bit mode, we always convert characters to UTF-8 so that values greater 
       than 255 can be passed to non-UTF 16-bit strings. In 8-bit mode we
       convert to UTF-8 if we are in UTF mode. Values greater than 127 in UTF 
       mode must have come from \x{...} or octal constructs because values from
       \x.. get this far only in non-UTF mode. */
-      
+
       if (use_pcre16 || use_utf)
-        { 
+        {
         pcre_uint8 buff8[8];
         int ii, utn;
         utn = ord2utf8(c, buff8);