VM Maker: VMMaker.oscog-eem.2673.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2673.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2673.mcz

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

Name: VMMaker.oscog-eem.2673
Author: eem
Time: 23 January 2020, 9:30:47.176937 am
UUID: ceb6ec91-3b0f-4fd3-93b7-19f6e445c4a5
Ancestors: VMMaker.oscog-eem.2672

Placate Slang by adding a macro for the internal vs external tag on the end of the plugin moduleName, so that we keep the changes in VMMaker.oscog-eem.2671 & VMMaker.oscog-eem.2672 for hack #if declarations, and don't have to add yet another hack to handle the old style (and more verbose) moduleName declaration. And move declareModuleName: to VMPluginCodeGenerator where it belongs.

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

Item was removed:
- ----- Method: CCodeGenerator>>declareModuleName: (in category 'public') -----
- declareModuleName: nameString
- "add the declaration of a module name, version and local/external tag"
-
- self var: #moduleName declareC:'const char *moduleName =
- #ifdef SQUEAK_BUILTIN_PLUGIN
- "', nameString,' (i)"
- #else
- "', nameString,' (e)"
- #endif
- '.
- "and for run-time use, answer the string"
- ^nameString, ' (i)'!

Item was added:
+ ----- Method: VMPluginCodeGenerator>>declareModuleName: (in category 'public') -----
+ declareModuleName: nameString
+ "add the declaration of a module name, version and local/external tag"
+
+ self var: #moduleName declareC: 'const char *moduleName = "', nameString,' " INT_EXT'!

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; 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>' '<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: '/* Default EXPORT macro that does nothing (see comment in sq.h): */
  #define EXPORT(returnType) returnType
 
  /* 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 */
 
  #define true 1
  #define false 0
  #define null 0  /* using ''null'' because nil is predefined in Think C */
  #ifdef SQUEAK_BUILTIN_PLUGIN
  # undef EXPORT
  # define EXPORT(returnType) static returnType
+ # define INT_EXT "(i)"
+ #else
+ # define INT_EXT "(e)"
  #endif'; cr; cr.
  self addHeaderFile: '"sqMemoryAccess.h"'.
  "Additional header files; include squeak VM ones last"
  self emitHeaderFiles: (headerFiles reject: [:hdr| hdr includes: $<]) on: aStream.
  self maybePutPreambleFor: pluginClass on: aStream.
  aStream cr!