[BUG] [FIX] type of 'interpreterProxy' variable

Tim Rowledge rowledge at interval.com
Thu Apr 15 22:43:41 UTC 1999


Whilst trying to pluginise some of the code I took out to reduce the VM size I
fell victim to a problem with the typing of the interpreterProxy variable.
Normally, when writing the source code for a plugin into the main interp.c
file, this needs to be an int. If it is declared as a VirtualMachine* the
implementation of setInterpreter() will upset the compiler.
However, if the plugin is being generated into a separate file to become a dll,
it needs to be declared VirtualMachine*, or the plugin version of setInterpreter() will
break....

I _think_ a good solution is to slightly modify InterpreterPlugin
class>declareCVarsIn: to check and do the right thing.

'From Squeak 2.3 of January 14, 1999 on 15 April 1999 at 3:42:23 pm'!

!InterpreterPlugin class methodsFor: 'translation' stamp: 'TPR 4/15/1999 15:29'!
declareCVarsIn: aCCodeGenerator
	"Note: This method must be implemented by all subclasses to declare
variables"
	"if we are generating an external plugin we have to declare
interpreterProxy as the structure below - otherwise leave it to default to an
int"
	aCCodeGenerator isGeneratingPluginCode
		ifTrue:[ aCCodeGenerator var: 'interpreterProxy'
			declareC: 'struct VirtualMachine *interpreterProxy']
! !


-- 
Useful random insult:- If his IQ was two points higher he'd be a rock.
Tim Rowledge:  rowledge at interval.com (w)  +1 (650) 842-6110 (w)
 tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>





More information about the Squeak-dev mailing list