summaryrefslogtreecommitdiff
path: root/Source/Modules/com.cxx
diff options
context:
space:
mode:
authorJan Jezabek <jezabek@poczta.onet.pl>2008-07-31 10:45:10 +0000
committerJan Jezabek <jezabek@poczta.onet.pl>2008-07-31 10:45:10 +0000
commitba105e822255d7afff93deecd9226094899ce621 (patch)
tree4e158bab9a3a8fd7cf9d93cea2f15e67230a96c3 /Source/Modules/com.cxx
parentf84a859efe7f908d269e1db29b6ca7f45b7d0157 (diff)
downloadswig-ba105e822255d7afff93deecd9226094899ce621.tar.gz
Basic support for constants.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-jezabek@10721 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Source/Modules/com.cxx')
-rw-r--r--Source/Modules/com.cxx43
1 files changed, 42 insertions, 1 deletions
diff --git a/Source/Modules/com.cxx b/Source/Modules/com.cxx
index 84128ebe1..ca4114e7f 100644
--- a/Source/Modules/com.cxx
+++ b/Source/Modules/com.cxx
@@ -839,6 +839,32 @@ public:
return ret;
}
+ /* -----------------------------------------------------------------------
+ * constantWrapper()
+ * ------------------------------------------------------------------------ */
+
+ virtual int constantWrapper(Node *n) {
+
+ generate_property_declaration_flag = true;
+ variable_wrapper_flag = true;
+
+ if (!wrapping_member_flag) {
+ global_variable_flag = true;
+ variable_name = Getattr(n, "sym:name");
+ } else {
+ static_flag = true;
+ }
+
+ int ret = Language::variableWrapper(n);
+
+ global_variable_flag = false;
+ static_flag = false;
+ variable_wrapper_flag = false;
+ generate_property_declaration_flag = false;
+
+ return ret;
+ }
+
/* ----------------------------------------------------------------------
* memberfunctionHandler()
* ---------------------------------------------------------------------- */
@@ -896,6 +922,21 @@ public:
return SWIG_OK;
}
+ /* ----------------------------------------------------------------------
+ * memberconstantHandler()
+ * ---------------------------------------------------------------------- */
+
+ virtual int memberconstantHandler(Node *n) {
+
+ variable_name = Getattr(n, "sym:name");
+ wrapping_member_flag = true;
+ Language::memberconstantHandler(n);
+ constantWrapper(n);
+ wrapping_member_flag = false;
+
+ return SWIG_OK;
+ }
+
/* -----------------------------------------------------------------------------
* constructorHandler()
* ----------------------------------------------------------------------------- */
@@ -1473,7 +1514,7 @@ public:
if (proxy_flag) {
for (Iterator func = First(proxy_class_member_functions); func.item; func = Next(func)) {
- Printf(proxy_class_vtable_code, ",\n (SWIG_funcptr)%s", func.item);
+ Printf(proxy_class_vtable_code, ",\n (SWIG_funcptr) %s", func.item);
}
emitProxyClassDefAndCPPCasts(n);