From 09d047285c4363da81fdcde7c9f72b670c162935 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Mon, 10 Mar 2003 14:01:42 +0000 Subject: [PATCH] Fix to constant handling. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4493 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/lang.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SWIG/Source/Modules/lang.cxx b/SWIG/Source/Modules/lang.cxx index 4b90f04d7..812927358 100644 --- a/SWIG/Source/Modules/lang.cxx +++ b/SWIG/Source/Modules/lang.cxx @@ -404,11 +404,16 @@ int Language::constantDirective(Node *n) { if (!value) { value = Copy(name); } else { - if (checkAttribute(n,"type","char")) { + /* if (checkAttribute(n,"type","char")) { value = NewString(value); } else { value = NewStringf("%(escape)s", value); } + */ + Setattr(n,"rawvalue",value); + value = NewStringf("%(escape)s", value); + if (!Len(value)) Append(value,"\\0"); + /* Printf(stdout,"'%s' = '%s'\n", name, value); */ } Setattr(n,"value", value); this->constantWrapper(n);