Author: marvin
Date: Wed Jan 4 22:36:31 2012
New Revision: 1227366
URL: http://svn.apache.org/viewvc?rev=1227366&view=rev
Log:
LUCY-206 Spell out perlapi function to_utf8_lower.
Perl 5.15.6 has broken to_utf8_lower() in a way which is hard to fix. Use the
underlying function Perl__to_utf8_lower_flags() for that specific Perl
version.
For earlier Perls, use the fully qualified function Perl_to_utf8_lower().
This probably speeds us up a bit on threaded perls, since we pass aTHX_
instead of getting the implicit context (see perlguts).
Modified:
incubator/lucy/branches/0.3/ (props changed)
incubator/lucy/branches/0.3/perl/xs/Lucy/Analysis/CaseFolder.c
Propchange: incubator/lucy/branches/0.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 4 22:36:31 2012
@@ -1 +1 @@
-/incubator/lucy/trunk:1225600-1225601,1226190-1226191,1226199,1226310
+/incubator/lucy/trunk:1225600-1225601,1226190-1226191,1226199,1226310,1227324
Modified: incubator/lucy/branches/0.3/perl/xs/Lucy/Analysis/CaseFolder.c
URL:
http://svn.apache.org/viewvc/incubator/lucy/branches/0.3/perl/xs/Lucy/Analysis/CaseFolder.c?rev=1227366&r1=1227365&r2=1227366&view=diff
==============================================================================
--- incubator/lucy/branches/0.3/perl/xs/Lucy/Analysis/CaseFolder.c (original)
+++ incubator/lucy/branches/0.3/perl/xs/Lucy/Analysis/CaseFolder.c Wed Jan 4
22:36:31 2012
@@ -26,10 +26,6 @@
#include "Lucy/Util/Memory.h"
#include "Lucy/Util/StringHelper.h"
-#ifndef _to_utf8_lower_flags
- #define _to_utf8_lower_flags Perl__to_utf8_lower_flags
-#endif
-
static size_t
S_lc_to_work_buf(lucy_CaseFolder *self, uint8_t *source, size_t len,
uint8_t **buf, uint8_t **limit) {
@@ -38,10 +34,16 @@ S_lc_to_work_buf(lucy_CaseFolder *self,
uint8_t *dest_start = dest;
uint8_t *const end = source + len;
uint8_t utf8_buf[7];
+ dTHX;
while (source < end) {
STRLEN buf_utf8_len;
- (void)to_utf8_lower(source, utf8_buf, &buf_utf8_len);
+ #if (PERL_VERSION == 15 && PERL_SUBVERSION >= 6)
+ Perl__to_utf8_lower_flags(aTHX_ source, utf8_buf, &buf_utf8_len,
+ 0, NULL);
+ #else
+ Perl_to_utf8_lower(aTHX_ source, utf8_buf, &buf_utf8_len);
+ #endif
// Grow if necessary.
if (((STRLEN)(*limit - dest)) < buf_utf8_len) {