From 04b60a150865fa10b6ebabd60882c7b56681ce7e Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 14 Dec 2012 08:00:22 +0000 Subject: CFFI - Fix some string constants are incorrect git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13963 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/cffi.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/Modules/cffi.cxx b/Source/Modules/cffi.cxx index d3f0391d0..88f82b647 100644 --- a/Source/Modules/cffi.cxx +++ b/Source/Modules/cffi.cxx @@ -565,7 +565,13 @@ void CFFI::emit_defun(Node *n, String *name) { int CFFI::constantWrapper(Node *n) { String *type = Getattr(n, "type"); - String *converted_value = convert_literal(Getattr(n, "value"), type); + String *converted_value; + if (SwigType_type(type) == T_STRING) { + converted_value = NewString(Getattr(n, "rawval")); + } else { + converted_value = convert_literal(Getattr(n, "value"), type); + } + String *name = lispify_name(n, Getattr(n, "sym:name"), "'constant"); if (Strcmp(name, "t") == 0 || Strcmp(name, "T") == 0) -- cgit v1.2.1