[Vm-dev] __VERSION__ in squeakvm classic

stes stes at telenet.be
Mon Mar 30 07:13:11 UTC 2020


A combination of "cmake" methods may also be used:

The following works for me as well:  in platforms/unix/vm/config.cmake

IF (CMAKE_C_COMPILER_ID MATCHES "SunPro")
  SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\" Compiler:
${CMAKE_C_COMPILER_VERSION}\"")
ELSE ()
  SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\" Compiler:
\"__VERSION__")
ENDIF (CMAKE_C_COMPILER_ID MATHCES "SunPro")

CONFIG_DEFINE (VM_BUILD_STRING)

This is a combination where for the "SunPro" compiler the variable
CMAKE_C_COMPILER_VERSION is used,
while for all other compilers the __VERSION__ is used.

The above method using CMAKE_C_COMPILER_VERSION  can be used for all C
compilers that do not define __VERSION__.

The above works fine for me,  and there is less of a risk that it breaks
something for other platforms.

So the patch is then:

bash-4.4$ svn diff platforms/
Index: platforms/unix/vm/config.cmake
===================================================================
--- platforms/unix/vm/config.cmake	(revision 3775)
+++ platforms/unix/vm/config.cmake	(working copy)
@@ -202,7 +202,11 @@
 
 # sqUnixMain.c
 
-SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\" Compiler:
\"__VERSION__")
+IF (CMAKE_C_COMPILER_ID MATCHES "SunPro") 
+  SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\"
Compiler: ${CMAKE_C_COMPILER_VERSION}\"") 
+ELSE ()
+  SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\"
Compiler: \"__VERSION__")
+ENDIF (CMAKE_C_COMPILER_ID MATHCES "SunPro")
 
 CONFIG_DEFINE (VM_BUILD_STRING)
 
Index: platforms/unix/vm-sound-Sun/sqUnixSoundSun.c
===================================================================
--- platforms/unix/vm-sound-Sun/sqUnixSoundSun.c	(revision 3775)
+++ platforms/unix/vm-sound-Sun/sqUnixSoundSun.c	(working copy)
@@ -72,7 +72,7 @@
 #endif
 
 static sqInt sound_Stop(void);
-static int sound_AvailableSpace(void);
+static sqInt sound_AvailableSpace(void);
 
 static int auFd=	       -1;   /* open on /dev/audio */
 static int auCtlFd=	       -1;   /* open on /dev/audioctl */




--
Sent from: http://forum.world.st/Squeak-VM-f104410.html


More information about the Vm-dev mailing list