00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "bconfig.h"
00024 #include "system.h"
00025 #include "coretypes.h"
00026 #include "tm.h"
00027 #include "version.c"
00028
00029 int main (int, char **);
00030
00031 int
00032 main (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
00033 {
00034 unsigned version = 0;
00035 unsigned char v[4];
00036 unsigned ix;
00037 char const *ptr = version_string;
00038 unsigned major, minor = 0;
00039 char s = 0;
00040
00041 major = atoi (ptr);
00042 while (*ptr && *ptr != '.')
00043 ptr++;
00044 if (*ptr)
00045 minor = atoi (ptr + 1);
00046 while (*ptr)
00047 if (*ptr++ == '(')
00048 {
00049 s = *ptr;
00050 break;
00051 }
00052
00053 v[0] = (major < 10 ? '0' : 'A' - 10) + major;
00054 v[1] = (minor / 10) + '0';
00055 v[2] = (minor % 10) + '0';
00056 v[3] = s ? s : '*';
00057
00058 for (ix = 0; ix != 4; ix++)
00059 version = (version << 8) | v[ix];
00060
00061 printf ("/* Generated automatically by the program `%s'\n", argv[0]);
00062 printf (" from `%s'. */\n", version_string);
00063 printf ("\n");
00064 printf ("#define GCOV_VERSION ((gcov_unsigned_t)%#08x) /* %.4s */\n",
00065 version, v);
00066
00067 return 0;
00068 }