From ac61cb16351bd19654c25786170c6c5795e13d96 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Mon, 3 Feb 2025 00:44:52 +0100 Subject: [PATCH] hbver: Fix displayed OpenWatcom and TinyC version Regards ... Detlef --- src/common/hbver.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/common/hbver.c b/src/common/hbver.c index 21b89d3903..455e73f98c 100644 --- a/src/common/hbver.c +++ b/src/common/hbver.c @@ -1293,12 +1293,17 @@ char * hb_verCompiler( void ) hb_strncpy( szSub, "++", sizeof( szSub ) - 1 ); #endif - iVerMajor = __WATCOMC__ / 100; - iVerMinor = __WATCOMC__ % 100; - - #if defined( __WATCOM_REVISION__ ) - iVerPatch = __WATCOM_REVISION__; + #if __WATCOMC__ < 1200 + iVerMajor = __WATCOMC__ / 100; + iVerMinor = __WATCOMC__ % 100; + #if defined( __WATCOM_REVISION__ ) + iVerPatch = __WATCOM_REVISION__; + #else + iVerPatch = 0; + #endif #else + iVerMajor = ( __WATCOMC__ - 1100 ) / 100; + iVerMinor = ( __WATCOMC__ - 1100 ) % 100; iVerPatch = 0; #endif @@ -1316,9 +1321,9 @@ char * hb_verCompiler( void ) pszName = "Tiny C Compiler"; - iVerMajor = __TINYC__ / 100; - iVerMinor = ( __TINYC__ % 100 ) / 10; - iVerPatch = ( __TINYC__ % 100 ) % 10; + iVerMajor = __TINYC__ / 10000; + iVerMinor = ( __TINYC__ % 10000) / 100; + iVerPatch = __TINYC__ % 100 ; #elif defined( __PCC__ )