summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-03-07 16:31:04 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-03-07 16:31:04 +0000
commitfa85f5ee481179f3453200d51f3d797e455dd529 (patch)
tree22da1ca3220507caa0c43e2ed3912d9d500b7ed4
parentb94e44e5b026e3dbc3405c0e73de398b27005600 (diff)
downloadpcre-fa85f5ee481179f3453200d51f3d797e455dd529.tar.gz
Some more #ifdefs for SUPPORT_UTF8.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@110 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog5
-rw-r--r--pcre_ord2utf8.c4
-rw-r--r--pcre_valid_utf8.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 90be550..105b5ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,11 @@ Version 7.1 05-Mar-07
support is not required. This saves 1.5-2K of code, which is important in
some applications.
+ Later: more #ifdefs are needed in pcre_ord2utf8.c and pcre_valid_utf8.c
+ so as not to refer to the tables, even though these functions will never be
+ called when UTF-8 support is disabled. Otherwise there are problems with a
+ shared library.
+
10. The emulated memmove() function in pcre_internal.h (provided for those
environments that have neither memmove() nor bcopy()) was defining its
arguments as char * instead of void *.
diff --git a/pcre_ord2utf8.c b/pcre_ord2utf8.c
index fc4d6de..43d4368 100644
--- a/pcre_ord2utf8.c
+++ b/pcre_ord2utf8.c
@@ -62,6 +62,7 @@ Returns: number of characters placed in the buffer
int
_pcre_ord2utf8(int cvalue, uschar *buffer)
{
+#ifdef SUPPORT_UTF8
register int i, j;
for (i = 0; i < _pcre_utf8_table1_size; i++)
if (cvalue <= _pcre_utf8_table1[i]) break;
@@ -73,6 +74,9 @@ for (j = i; j > 0; j--)
}
*buffer = _pcre_utf8_table2[i] | cvalue;
return i + 1;
+#else
+return 0; /* Keep compiler happy; this function won't ever be */
+#endif /* called when SUPPORT_UTF8 is not defined. */
}
/* End of pcre_ord2utf8.c */
diff --git a/pcre_valid_utf8.c b/pcre_valid_utf8.c
index 727fbe8..9f6323f 100644
--- a/pcre_valid_utf8.c
+++ b/pcre_valid_utf8.c
@@ -66,6 +66,7 @@ Returns: < 0 if the string is a valid UTF-8 string
int
_pcre_valid_utf8(const uschar *string, int length)
{
+#ifdef SUPPORT_UTF8
register const uschar *p;
if (length < 0)
@@ -123,6 +124,7 @@ for (p = string; length-- > 0; p++)
if ((*(++p) & 0xc0) != 0x80) return p - string;
}
}
+#endif
return -1;
}