Il 15/08/2023 22:54, Ron Pinkas ha scritto:
> Maybe something like this:
>
> unsigned long long llvalue = HB_VER_CVSID;
> unsigned long dw1 = llvalue >> 32; // Get the first DWORD (the higher 32 bits)
> unsigned long dw2 = llvalue & 0xFFFFFFFF; // Get the second DWORD (the lower 32 bits)
>
> unsigned short hiword1 = dw1 >> 16; // Get the high word of dw1
> unsigned short loword1 = dw1 & 0xFFFF; // Get the low word of dw1
> unsigned short hiword2 = dw2 >> 16; // Get the high word of dw2
> unsigned short loword2 = dw2 & 0xFFFF; // Get the low word of dw2
>
> fprintf(h, "FILEVERSION %u,%u,%u,%u\n", hiword1, loword1, hiword2, loword2);
Perfect! This is working fine. Please commit. BCC32 and BCC54 builds are OK!
int main( int argc, char * argv[] )
{
if( argc >= 7 )
{
FILE * h = fopen( argv[ 1 ], "wb" );
if( h )
{
SYSTEMTIME t;
char * cCompiler = _hb_verCompiler();
char * aMo[] = { "January", "February", "March",
"April", "May", "June", "July", "August", "September", "October",
"November", "December" };
char szParam[ 265 ];
unsigned long long llvalue = HB_VER_CVSID;
unsigned long dw1 = llvalue >> 32; // Get the first DWORD (the
higher 32 bits)
unsigned long dw2 = llvalue & 0xFFFFFFFF; // Get the second DWORD
(the lower 32 bits)
unsigned short hiword1 = dw1 >> 16; // Get the high word of dw1
unsigned short loword1 = dw1 & 0xFFFF; // Get the low word of dw1
unsigned short hiword2 = dw2 >> 16; // Get the high word of dw2
unsigned short loword2 = dw2 & 0xFFFF; // Get the low word of dw2
GetLocalTime( &t );
fprintf( h, "1 VERSIONINFO\n" );
fprintf(h, "FILEVERSION %u,%u,%u,%u\n", hiword1, loword1, hiword2,
loword2);
fprintf(h, "PRODUCTVERSION %u,%u,%u,%u\n", hiword1, loword1,
hiword2, loword2);
// fprintf( h, "FILEVERSION %d,%d,%d,%lld\n",
HB_VER_MAJOR,HB_VER_MINOR,HB_VER_REVISION,HB_VER_CVSID );
// fprintf( h, "PRODUCTVERSION %d,%d,%d,%lld\n",
HB_VER_MAJOR,HB_VER_MINOR,HB_VER_REVISION,HB_VER_CVSID );