Development > Newbie Coding

new makro

<< < (2/4) > >>

Mattn:
see https://sourceforge.net/apps/trac/ufoai/changeset/29236

Mattn:
the "real" fix for this would be to use the version specified in configure.ac and attach the svn revision number extracted with svnversion or svn info

Muton:
> maybe mingw also has the command svnversion
The package we support own it
but you cant count on it

> - otherwise
.... or file ufoaiSOURCEfolder/.svn/entries line 4


> sprintf(verString, "UFO:AI V2.3 dev revision: %i\n", rev);

Thats a better way
but if the macro is not provided than ....
UFO:AI V2.3 dev revision: x86 Apr 1 2010 whathever
A user would think revision x86

> My biggest question is: how do you get the svn rev number into the call of mingW ??
Does configure && make work under MinGW ?


There is a way to join macros url1 url2
The code is not working
its 10pm and i'm not getting it  :P
error: pasting ""2.3-dev "" and ""1234"" does not give a valid preprocessing token

--- Code: ---#include <stdio.h>

#  ifdef REVISION
#    define UFO_REVISION REVISION
#    define xstr(s) str(s)
#    define str(s) #s
#    define JOIN(x, y) JOIN_AGAIN(x, y)
#    define JOIN_AGAIN(x, y) x ## y
#    define UFO_VERSION JOIN("2.3-dev ",xstr(UFO_REVISION))
#  else
#    define UFO_VERSION "2.3-dev"
#  endif

void main(void) {
printf("%s\n",UFO_VERSION );
}

--- End code ---

Mattn:

--- Quote from: Muton on April 06, 2010, 10:09:23 pm ---> My biggest question is: how do you get the svn rev number into the call of mingW ??
Does configure && make work under MinGW ?

--- End quote ---

that is the long term goal as i would like to get rid of the c::b project files completely. It works for some users already - but only with manual setup - afair BTAxis, Destructavator and bayo are using (or were using) configure and make under windows.

if you have:

--- Code: ---gcc -DSOMEVAR=1 ....
--- End code ---

you can do:

--- Code: ---#if SOMEVAR > 0
Com_sprintf(buf, sizeof(buf), "Some nice info %s", DOUBLEQUOTE(SOMEVAR));
#endif

--- End code ---

or


--- Code: ---#if SOMEVAR > 0
Com_sprintf(buf, sizeof(buf), "Some nice info %i", SOMEVAR);
#endif

--- End code ---

Mattn:
see r29245

but keep in mind that this must not be up-to-date if you don't do a clean build.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version