CC: | dam [...] opencsw.org |
Subject: | CS_UNITEXT_TYPE not available in Sybase OCS-12_5 |
The original cspublic.h from Sybase OCS-12_5 does not have a definition for CS_UNITEXT_TYPE.
The attached patch uses the definition only when it is available.
Subject: | 0001-Use-CS_UNITEXT_TYPE-only-when-available.patch |
From 32772f45d772b1721b47f7487b9c46b5d392e3c3 Mon Sep 17 00:00:00 2001
From: Dagobert Michelsen <dam@opencsw.org>
Date: Wed, 10 Nov 2010 11:39:56 +0100
Subject: [PATCH] Use CS_UNITEXT_TYPE only when available
---
dbdimp.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dbdimp.c b/dbdimp.c
index 1bbe697..0abfbf7 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -4013,8 +4013,11 @@ AV * syb_st_fetch(SV *sth, imp_sth_t *imp_sth) {
}
#if defined(DBD_CAN_HANDLE_UTF8)
if (imp_dbh->enable_utf8
- && (imp_sth->coldata[i].realType == CS_UNICHAR_TYPE ||
- imp_sth->coldata[i].realType == CS_UNITEXT_TYPE)) {
+ && (imp_sth->coldata[i].realType == CS_UNICHAR_TYPE
+#if defined(CS_UNITEXT_TYPE)
+ || imp_sth->coldata[i].realType == CS_UNITEXT_TYPE
+#endif
+ )) {
U8 *value = SvPV_nolen(sv);
STRLEN len = SvLEN(sv);
--
1.7.3