Slang: Suppressing 'static' declarations

Eddie Cottongim cottonsqueak at earthlink.net
Fri Jan 13 05:15:59 UTC 2006


Thanks Stephan. I tried using a header file and this worked. However, it 
means I have to remove the Plugin's variable declarations so the 
translator doesn't generate a definition for them, which in turn means 
that I can't reference them from Slang at all (can only use cCode).  I 
might try hacking the CCodeGenerator to put out the extern more directly.

Eddie

Stephan Rudlof wrote:

>Some refinements:
>
>On 12.01.2006 20:20, I wrote:
>  
>
>>Hello Eddie,
>>
>>there is Object>>cCode: or Object>>cCode:inSmalltalk:, see e.g.
>>  RePlugin>>allocateByteArrayAndSetRcvrPCREPtrFromPCRE: aPCREPtr
>>for an example. With these constructs you can inject arbitrary C code
>>into the generated C code.
>>    
>>
>
>  
>
>>In RePlugin>>declareCVarsIn:
>>    
>>
>
>You should look into the corresponding Category to see what you have to
>do else.
>
>  
>
>>you can see how to declare a header file,
>>there is the line
>>  cg addHeaderFile:'"rePlugin.h"'.
>>; this header file is located in dir
>>  SomeBaseDir/platforms/Cross/plugins/RePlugin/
>>    
>>
>
>  
>
>>You could put the extern vars into a respective header file.
>>    
>>
>
>should be: You could put the *declarations* of the extern vars
>(definitions being in some *.c file) into a respective header file.
>
>Stephan
>  
>




More information about the Squeak-dev mailing list