[Vm-dev] VM Maker: VMMaker.oscog-eem.2944.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Feb 9 17:01:36 UTC 2021

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

==================== Summary ====================

Name: VMMaker.oscog-eem.2944
Author: eem
Time: 9 February 2021, 9:01:28.421478 am
UUID: 242b00d2-2d09-4363-8f25-cedcd6ee2187
Ancestors: VMMaker.oscog-eem.2943

Continuing on from VMMaker.oscog-eem.2943 we have no business overriding the default EXPORT definitoon for external plugins.  We define EXPORT to map to static for internal plugins only.

=============== Diff against VMMaker.oscog-eem.2943 ===============

Item was changed:
  ----- Method: VMPluginCodeGenerator>>emitCHeaderOn: (in category 'C code generator') -----
  emitCHeaderOn: aStream
  	"Write a C file header onto the given stream, adding include files and some basic definitions."
  	| standardHeaders |
+ 	aStream nextPutAll: (self fileHeaderVersionStampForSourceClass: pluginClass); cr.
- 	aStream nextPutAll: (self fileHeaderVersionStampForSourceClass: pluginClass); cr; cr.
  	"config.h should always go first because config.h properly defines flags.
  	 One of those is _GNU_SOURCE, as explained in https://www.gnu.org/software/autoconf/manual/autoconf.html#Posix-Variants,
  	 where the Autoconf macro AC_USE_SYSTEM_EXTENSIONS makes sure this is defined."
  	standardHeaders := #('"config.h"' '<math.h>' '"sqMathShim.h"' '<stdio.h>' '<stdlib.h>' '<string.h>' '<time.h>').
  	self emitHeaderFiles: standardHeaders on: aStream.
  	headerFiles := headerFiles copyWithoutAll: standardHeaders.
  	"Additional header files; include C library ones first."
  	self emitHeaderFiles: (headerFiles select: [:hdr| hdr includes: $<]) on: aStream.
  	aStream cr; nextPutAll: '/* Do not include the entire sq.h file but just those parts needed. */
  #include "sqConfig.h"			/* Configuration options */
  #include "sqVirtualMachine.h"	/*  The virtual machine proxy definition */
  #include "sqPlatformSpecific.h"	/* Platform specific definitions */'; cr; cr.
  	self addHeaderFile: '"sqMemoryAccess.h"'.
  	"Additional header files; include squeak VM ones last"
  	self emitHeaderFiles: (headerFiles reject: [:hdr| hdr includes: $<]) on: aStream.
+ 	aStream cr; nextPutAll: '#define true 1
- 	aStream cr; nextPutAll: '/* Default EXPORT macro that does nothing (see comment in sq.h): */
- #define EXPORT(returnType) returnType
- #define true 1
  #define false 0
  #define null 0  /* using ''null'' because nil is predefined in Think C */
  # undef EXPORT
  # define EXPORT(returnType) static returnType
  # define INT_EXT "(i)"
  # define INT_EXT "(e)"
  #endif'; cr.
  	self maybePutPreambleFor: pluginClass on: aStream.
  	aStream cr!

More information about the Vm-dev mailing list