Commit ac21d34b authored by Alexandre Julliard's avatar Alexandre Julliard

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

version.
parent 8f4042c5
...@@ -59,7 +59,7 @@ static char usage[] = ...@@ -59,7 +59,7 @@ static char usage[] =
; ;
static char version_string[] = static char version_string[] =
"Wine Message Compiler Version " WMC_FULLVERSION "\n" "Wine Message Compiler version " PACKAGE_VERSION "\n"
"Copyright 2000 Bertho A. Stultiens\n" "Copyright 2000 Bertho A. Stultiens\n"
; ;
......
...@@ -25,16 +25,6 @@ ...@@ -25,16 +25,6 @@
#include "wmctypes.h" #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 * The default codepage setting is only to
* read and convert input which is non-message * read and convert input which is non-message
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
*/ */
static char str_header[] = 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" "/* Source : %s */\n"
"/* Cmdline: %s */\n" "/* Cmdline: %s */\n"
"/* Date : %s */\n" "/* Date : %s */\n"
......
...@@ -103,7 +103,7 @@ static char usage[] = ...@@ -103,7 +103,7 @@ static char usage[] =
"with -o, then the output is written to \"wrc.tab.res\"\n" "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" "Copyright 1998-2000 Bertho A. Stultiens\n"
" 1994 Martin von Loewis\n"; " 1994 Martin von Loewis\n";
...@@ -198,6 +198,32 @@ static struct option long_options[] = { ...@@ -198,6 +198,32 @@ static struct option long_options[] = {
{ 0, 0, 0, 0 } { 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[]) int main(int argc,char *argv[])
{ {
extern char* optarg; extern char* optarg;
...@@ -215,11 +241,7 @@ int main(int argc,char *argv[]) ...@@ -215,11 +241,7 @@ int main(int argc,char *argv[])
now = time(NULL); now = time(NULL);
/* Set the default defined stuff */ /* Set the default defined stuff */
wpp_add_cmdline_define("__WRC__=" WRC_EXP_STRINGIZE(WRC_MAJOR_VERSION)); set_version_defines();
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));
wpp_add_cmdline_define("RC_INVOKED=1"); wpp_add_cmdline_define("RC_INVOKED=1");
wpp_add_cmdline_define("__WIN32__=1"); wpp_add_cmdline_define("__WIN32__=1");
wpp_add_cmdline_define("__FLAT__=1"); wpp_add_cmdline_define("__FLAT__=1");
......
...@@ -25,17 +25,6 @@ ...@@ -25,17 +25,6 @@
#include "wrctypes.h" #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 */ /* From wrc.c */
extern int debuglevel; extern int debuglevel;
#define DEBUGLEVEL_NONE 0x0000 #define DEBUGLEVEL_NONE 0x0000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment