Skip to content

Commit

Permalink
Avoiding the exporting of implicit variables
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Apr 4, 2022
1 parent 44934c0 commit 4b68039
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions smalltalksrc/Melchor/CCodeGeneratorGlobalStructure.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,23 @@ CCodeGeneratorGlobalStructure >> emitCVariablesOn: aStream [
ifTrue: [structure]
ifFalse: [nonstruct].
decl := variableDeclarations at: varString ifAbsent: ['sqInt ' , varString].
decl first == $# "support cgen var: #bytecodeSetSelector declareC: '#define bytecodeSetSelector 0' hack"
ifTrue:
[target nextPutAll: decl; cr]
ifFalse:
[self isGeneratingPluginCode
(decl beginsWith: 'implicit') ifFalse: [
decl first == $# "support cgen var: #bytecodeSetSelector declareC: '#define bytecodeSetSelector 0' hack"
ifTrue:
[varString = 'interpreterProxy'
ifTrue: "quite special..."
[self preDeclareInterpreterProxyOn: target]
ifFalse: [target nextPutAll: 'static ']]
[target nextPutAll: decl; cr]
ifFalse:
[(self vmClass mustBeGlobal: varString) ifFalse:
[target nextPutAll: (inStruct ifTrue: ['_iss '] ifFalse: ['static '])]].
target nextPutAll: decl; nextPut: $;; cr]].
[self isGeneratingPluginCode
ifTrue:
[varString = 'interpreterProxy'
ifTrue: "quite special..."
[self preDeclareInterpreterProxyOn: target]
ifFalse: [target nextPutAll: 'static ']]
ifFalse:
[(self vmClass mustBeGlobal: varString) ifFalse:
[target nextPutAll: (inStruct ifTrue: ['_iss '] ifFalse: ['static '])]].
target nextPutAll: decl; nextPut: $;; cr]
]
].
structure
nextPutAll: '#undef _iss'; cr;
nextPutAll: '#if SQ_USE_GLOBAL_STRUCT'; cr;
Expand Down

0 comments on commit 4b68039

Please sign in to comment.