[Vm-dev] VM Maker: VMMaker.oscog-eem.1468.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Sep 24 18:42:36 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1468.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1468
Author: eem
Time: 24 September 2015, 11:35:27.891 am
UUID: 2b6a8fd8-cddf-447d-bee4-11d53d2ef9bc
Ancestors: VMMaker.oscog-eem.1467
Slang:
Fix emitCFunctionPrototype:generator:isPrototype: for funciton pointer return types.
=============== Diff against VMMaker.oscog-eem.1467 ===============
Item was changed:
----- Method: TMethod>>emitCFunctionPrototype:generator:isPrototype: (in category 'C code generation') -----
emitCFunctionPrototype: aStream generator: aCodeGen isPrototype: isPrototype "<Boolean>"
"Emit a C function header for this method onto the given stream."
+ | returnTypeIsFunctionPointer |
+ returnTypeIsFunctionPointer := returnType last = $)
+ and: [returnType includesSubString: (aCodeGen cFunctionNameFor: selector)].
-
export
+ ifTrue:
+ [aStream nextPutAll: 'EXPORT('; nextPutAll: returnType; nextPut: $)]
- ifTrue:[aStream nextPutAll: 'EXPORT('; nextPutAll: returnType; nextPut: $)]
ifFalse:
[self isStatic
ifTrue: [aStream nextPutAll: 'static ']
ifFalse:
[isPrototype ifTrue:
[aStream nextPutAll: 'extern ']].
(isPrototype or: [inline ~~ #always]) ifFalse: [aStream nextPutAll: 'inline '].
aStream nextPutAll: returnType].
+ (functionAttributes isNil or: [returnTypeIsFunctionPointer]) ifFalse:
- functionAttributes ifNotNil:
[aStream space; nextPutAll: functionAttributes].
isPrototype ifTrue: [aStream space] ifFalse: [aStream cr].
+ returnTypeIsFunctionPointer ifFalse:
+ [aStream
+ nextPutAll: (aCodeGen cFunctionNameFor: selector);
+ nextPut: $(.
+ args isEmpty
+ ifTrue: [aStream nextPutAll: #void]
+ ifFalse:
+ [args
+ do: [:arg| aStream nextPutAll: (self declarationAt: arg)]
+ separatedBy: [aStream nextPutAll: ', ']].
+ aStream nextPut: $)]!
- (returnType last = $)
- and: [returnType includesSubString: (aCodeGen cFunctionNameFor: selector)]) ifTrue:
- ["Hack fix for e.g. <returnTypeC: 'void (*setInterruptCheckChain(void (*aFunction)(void)))()'>"
- ^self].
- aStream
- nextPutAll: (aCodeGen cFunctionNameFor: selector);
- nextPut: $(.
- args isEmpty
- ifTrue: [aStream nextPutAll: #void]
- ifFalse:
- [args
- do: [:arg| aStream nextPutAll: (self declarationAt: arg)]
- separatedBy: [ aStream nextPutAll: ', ' ]].
- aStream nextPut: $)!
More information about the Vm-dev
mailing list