Set the version we report in wmc and wrc from the global Wine

version.
oldstable
Alexandre Julliard 2005-10-10 10:43:41 +00:00
parent 8f4042c574
commit ac21d34b26
5 changed files with 30 additions and 29 deletions

View File

@ -59,7 +59,7 @@ static char usage[] =
;
static char version_string[] =
"Wine Message Compiler Version " WMC_FULLVERSION "\n"
"Wine Message Compiler version " PACKAGE_VERSION "\n"
"Copyright 2000 Bertho A. Stultiens\n"
;

View File

@ -25,16 +25,6 @@
#include "wmctypes.h"
#define WMC_MAJOR_VERSION 1
#define WMC_MINOR_VERSION 0
#define WMC_MICRO_VERSION 0
#define WMC_RELEASEDATE "(12-Jun-2000)"
#define WMC_STRINGIZE(a) #a
#define WMC_VERSIONIZE(a,b,c) WMC_STRINGIZE(a) "." WMC_STRINGIZE(b) "." WMC_STRINGIZE(c)
#define WMC_VERSION WMC_VERSIONIZE(WMC_MAJOR_VERSION, WMC_MINOR_VERSION, WMC_MICRO_VERSION)
#define WMC_FULLVERSION WMC_VERSION " " WMC_RELEASEDATE
/*
* The default codepage setting is only to
* read and convert input which is non-message

View File

@ -88,7 +88,7 @@
*/
static char str_header[] =
"/* This file is generated with wmc version " WMC_FULLVERSION ". Do not edit! */\n"
"/* This file is generated with wmc version " PACKAGE_VERSION ". Do not edit! */\n"
"/* Source : %s */\n"
"/* Cmdline: %s */\n"
"/* Date : %s */\n"

View File

@ -103,7 +103,7 @@ static char usage[] =
"with -o, then the output is written to \"wrc.tab.res\"\n"
;
static const char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n"
static const char version_string[] = "Wine Resource Compiler version " PACKAGE_VERSION "\n"
"Copyright 1998-2000 Bertho A. Stultiens\n"
" 1994 Martin von Loewis\n";
@ -198,6 +198,32 @@ static struct option long_options[] = {
{ 0, 0, 0, 0 }
};
static void set_version_defines(void)
{
char *version = xstrdup( PACKAGE_VERSION );
char *major, *minor, *patchlevel;
char buffer[100];
if ((minor = strchr( version, '.' )))
{
major = version;
*minor++ = 0;
if ((patchlevel = strchr( minor, '.' ))) *patchlevel++ = 0;
}
else /* pre 0.9 version */
{
major = NULL;
patchlevel = version;
}
sprintf( buffer, "__WRC__=%s", major ? major : "0" );
wpp_add_cmdline_define(buffer);
sprintf( buffer, "__WRC_MINOR__=%s", minor ? minor : "0" );
wpp_add_cmdline_define(buffer);
sprintf( buffer, "__WRC_PATCHLEVEL__=%s", patchlevel ? patchlevel : "0" );
wpp_add_cmdline_define(buffer);
free( version );
}
int main(int argc,char *argv[])
{
extern char* optarg;
@ -215,11 +241,7 @@ int main(int argc,char *argv[])
now = time(NULL);
/* Set the default defined stuff */
wpp_add_cmdline_define("__WRC__=" WRC_EXP_STRINGIZE(WRC_MAJOR_VERSION));
wpp_add_cmdline_define("__WRC_MINOR__=" WRC_EXP_STRINGIZE(WRC_MINOR_VERSION));
wpp_add_cmdline_define("__WRC_MICRO__=" WRC_EXP_STRINGIZE(WRC_MICRO_VERSION));
wpp_add_cmdline_define("__WRC_PATCH__=" WRC_EXP_STRINGIZE(WRC_MICRO_VERSION));
set_version_defines();
wpp_add_cmdline_define("RC_INVOKED=1");
wpp_add_cmdline_define("__WIN32__=1");
wpp_add_cmdline_define("__FLAT__=1");

View File

@ -25,17 +25,6 @@
#include "wrctypes.h"
#define WRC_MAJOR_VERSION 1
#define WRC_MINOR_VERSION 1
#define WRC_MICRO_VERSION 9
#define WRC_RELEASEDATE "(31-Dec-2000)"
#define WRC_STRINGIZE(a) #a
#define WRC_EXP_STRINGIZE(a) WRC_STRINGIZE(a)
#define WRC_VERSIONIZE(a,b,c) WRC_STRINGIZE(a) "." WRC_STRINGIZE(b) "." WRC_STRINGIZE(c)
#define WRC_VERSION WRC_VERSIONIZE(WRC_MAJOR_VERSION, WRC_MINOR_VERSION, WRC_MICRO_VERSION)
#define WRC_FULLVERSION WRC_VERSION " " WRC_RELEASEDATE
/* From wrc.c */
extern int debuglevel;
#define DEBUGLEVEL_NONE 0x0000