From 92dbf178bc6373db4e40fe39d186752ab73172b8 Mon Sep 17 00:00:00 2001 From: Henning Thielemann Date: Thu, 1 Apr 2004 15:49:16 +0000 Subject: [PATCH] made enum block_type a protected member of class MODULA3, hope that VC++ 6 is satisfied with that git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5818 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/modula3.cxx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Source/Modules/modula3.cxx b/Source/Modules/modula3.cxx index 544979703..50e19f1f9 100644 --- a/Source/Modules/modula3.cxx +++ b/Source/Modules/modula3.cxx @@ -16,7 +16,6 @@ char cvsroot_modula3_cxx[] = indent -sob -br -ce -nut -npsl */ - /* Report: - It's not a good concept to use member variables or global variables @@ -135,15 +134,18 @@ const char usageArgDir[] = class MODULA3:public Language { - +protected: enum block_type { no_block, constant, variable, type, revelation }; +private: struct M3File { String *f; Hash *import; block_type bt; + /* VC++ 6 doesn't allow the access to 'no_block' + if it is a private member of MODULA3 class */ M3File ():f (NewString ("")), import (NewHash ()), bt (no_block) { }; @@ -288,8 +290,7 @@ MODULA3 (): m3raw_class_modifiers (NULL), m3wrap_modifiers (NULL), upcasts_code (NULL), - m3raw_cppcasts_code (NULL), destructor_call (NULL), outfile (NULL) - { + m3raw_cppcasts_code (NULL), destructor_call (NULL), outfile (NULL) { } /************** some utility functions ***************/ @@ -2175,9 +2176,9 @@ MODULA3 (): bool isEnumItem = Strcmp (nodeType (n), "enumitem") == 0; if ((isConstant || isEnumItem) && ((pat.prefix == NIL) || (hasPrefix (name, pat.prefix))) && - ((pat.parentEnum == NIL) || - ((parentEnum != NIL) - && (Strcmp (pat.parentEnum, parentEnum) == 0)))) { + ((pat.parentEnum == NIL) || ((parentEnum != NIL) + && (Strcmp (pat.parentEnum, parentEnum) + == 0)))) { //printf("tag %s\n", Char(name)); String *srctype = Getitem (convdesc, 1); String *relationstr = Getitem (convdesc, 3); @@ -3849,10 +3850,10 @@ MODULA3 (): count++; plist = nextSibling (plist); } - String *arg = (!pn - || (count > 1)) ? NewStringf ("arg%d", - arg_num) : Copy (Getattr (p, - "name")); + String *arg = (!pn || (count > 1)) ? NewStringf ("arg%d", + arg_num) : + Copy (Getattr (p, + "name")); return arg; }