VM Maker: VMMaker.oscog-eem.2943.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.2943.mcz

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

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

Name: VMMaker.oscog-eem.2943
Author: eem
Time: 8 February 2021, 8:27:45.60406 pm
UUID: e003897d-8105-40a7-bffe-2e8f14f31b5b
Ancestors: VMMaker.oscog-eem.2942

Resolve the conflict between sqAssert.h's attempt to export warning and error to external plugins with the crude redefinition of the EXPORT macro on generating plugins. So so by moving the redefinition of EXPORT after a plugin's include files.

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

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>' '"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. */
- 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 */'; cr; cr.
- #include "sqPlatformSpecific.h" /* Platform specific definitions */
 
+ self addHeaderFile: '"sqMemoryAccess.h"'.
+ "Additional header files; include squeak VM ones last"
+ self emitHeaderFiles: (headerFiles reject: [:hdr| hdr includes: $<]) on: aStream.
+ 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 */
  #ifdef SQUEAK_BUILTIN_PLUGIN
  # undef EXPORT
  # define EXPORT(returnType) static returnType
  # define INT_EXT "(i)"
  #else
  # define INT_EXT "(e)"
+ #endif'; cr.
- #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!