diff --git a/src/archutils/Win32/verinc.c b/src/archutils/Win32/verinc.c index e12895d408..a0811fbcd0 100644 --- a/src/archutils/Win32/verinc.c +++ b/src/archutils/Win32/verinc.c @@ -1,72 +1,73 @@ -// Ehhh.... -// -// I think I'll just put this one in the public domain -// (with no warranty as usual). -// -// --Avery - -// took some ideas from OpenITG... -aj - -#include -#include -#include -#include - -typedef unsigned long ulong; - -int main(void) -{ - FILE *f; - ulong build=0; - char strdate[10], strtime[64]; - time_t tm; - //struct tm *ptm; - - // try to read the last version seen - if( f = fopen("version.bin","r") ) - { - fread( &build, sizeof(ulong), 1, f ); - fclose( f ); - } - - // increment the build number and write it - build++; - - if ( f = fopen("version.bin","wb") ) - { - fwrite(&build,sizeof(ulong),1,f); - fclose(f); - } -// printf("Incrementing to build %d\n",build); - - // get the current time - time(&tm); - - /* - //memcpy(version_time, asctime(localtime(&tm)), sizeof(version_time)-1); - ptm = localtime(&tm); - strftime(s, sizeof(s), "%Y%m%d", ptm); - s[sizeof(s)-1]=0; - */ - - // print the debug serial date/time - strftime( strdate, 15, "%Y%m%d", localtime(&tm) ); - strftime( strtime, 64, "%H:%M:%S %Z", localtime(&tm) ); - //memcpy( strtime, asctime(localtime(&tm)), 24 ); - - // zero out the newline character - strtime[sizeof(strtime)-1] = 0; - - // write to verstub - if ( f = fopen("verstub.cpp","w") ) - { - fprintf(f, - "unsigned long version_num = %ld;\n" - "extern const char *const version_date = \"%s\";\n" - "extern const char *const version_time = \"%s\";\n", - build, strdate, strtime); - fclose(f); - } - - return 0; -} +// Ehhh.... +// +// I think I'll just put this one in the public domain +// (with no warranty as usual). +// +// --Avery + +// took some ideas from OpenITG... -aj + +#include +#include +#include +#include + +typedef unsigned long ulong; + +int main(void) +{ + FILE *f; + ulong build=0; + char strdate[10], strtime[64]; + time_t tm; + //struct tm *ptm; + + // try to read the last version seen + if( f = fopen("version.bin","r") ) + { + fread( &build, sizeof(ulong), 1, f ); + fclose( f ); + } + + // increment the build number and write it + build++; + + if ( f = fopen("version.bin","wb") ) + { + fwrite(&build,sizeof(ulong),1,f); + fclose(f); + } +// printf("Incrementing to build %d\n",build); + + // get the current time + time(&tm); + + /* + //memcpy(version_time, asctime(localtime(&tm)), sizeof(version_time)-1); + ptm = localtime(&tm); + strftime(s, sizeof(s), "%Y%m%d", ptm); + s[sizeof(s)-1]=0; + */ + + // print the debug serial date/time + strftime( strdate, 15, "%Y%m%d", localtime(&tm) ); + strftime( strtime, 64, "%H:%M:%S %Z", localtime(&tm) ); + //memcpy( strtime, asctime(localtime(&tm)), 24 ); + + // zero out the newline character + strtime[sizeof(strtime)-1] = 0; + + // write to verstub + if ( f = fopen("verstub.cpp","w") ) + { + fprintf(f, + "#include \"ver.h\"\n" + "unsigned long const version_num = %ld;\n" + "extern char const * const version_date = \"%s\";\n" + "extern char const * const version_time = \"%s\";\n", + build, strdate, strtime); + fclose(f); + } + + return 0; +} diff --git a/src/archutils/Win32/verinc.exe b/src/archutils/Win32/verinc.exe index d17008756a..9d1bda4622 100644 Binary files a/src/archutils/Win32/verinc.exe and b/src/archutils/Win32/verinc.exe differ