summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwati Sharma <itawswati@gmail.com>2012-08-18 15:14:34 +0000
committerSwati Sharma <itawswati@gmail.com>2012-08-18 15:14:34 +0000
commitf7a382c4cfc29c7c3c62bc5f377db66679433419 (patch)
tree4ef6c4755502d99f3458641cbce359706e713e06
parent2dee1a92e3d8f60a213e53f58f96117a15242b92 (diff)
downloadswig-f7a382c4cfc29c7c3c62bc5f377db66679433419.tar.gz
Fix for globals.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-objc@13652 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r--Source/Modules/objc.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Modules/objc.cxx b/Source/Modules/objc.cxx
index 130cdeee3..b1b2029bc 100644
--- a/Source/Modules/objc.cxx
+++ b/Source/Modules/objc.cxx
@@ -605,7 +605,8 @@ int OBJECTIVEC::classHandler(Node *n) {
// And, dump everything to the proxy files
Printv(proxy_h_code, proxy_class_decl_code, NIL);
Printv(proxy_mm_code, proxy_class_defn_code, NIL);
-
+ Printv(proxy_h_code,proxy_global_function_decls,NIL);
+ Printv(proxy_mm_code,proxy_global_function_defns,NIL);
// Tidy up
Delete(proxy_class_qname);
proxy_class_qname = NULL;
@@ -984,6 +985,7 @@ void OBJECTIVEC::emitProxyGlobalFunctions(Node *n) {
SwigType *type = Getattr(n, "type");
ParmList *parmlist = Getattr(n, "parms");
String *crettype = SwigType_str(type, 0);
+ String *storage = Getattr(n, "storage");
String *objcrettype = NewString("");
String *imcall = NewString("");
String *function_defn = NewString("");
@@ -1099,9 +1101,14 @@ void OBJECTIVEC::emitProxyGlobalFunctions(Node *n) {
/* Write the function declaration to the proxy_h_code
and function definition to the proxy_mm_code */
+ if ((member_func_flag || member_constant_flag || Strcmp(storage, "friend") == 0 || Strcmp(storage, "typedef") == 0))
+ {
+ Printv(proxy_global_function_decls, function_decl, "\n", NIL);
+ Printv(proxy_global_function_defns, function_defn, "\n", NIL);
+ }else {
Printv(proxy_h_code, function_decl, "\n", NIL);
Printv(proxy_mm_code, function_defn, "\n", NIL);
-
+ }
//Delete(paramstring);
Delete(proxyfunctionname);
Delete(objcrettype);