1 /* Generate gcov version string from version.c. See gcov-io.h for
2 description of how the version string is generated.
3 Copyright (C) 2002 Free Software Foundation, Inc.
4 Contributed by Nathan Sidwell <nathan@codesourcery.com>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 #include "coretypes.h"
27 #include "version.c" /* We want the actual string. */
29 int main
PARAMS ((int, char **));
33 int argc ATTRIBUTE_UNUSED
;
39 char const *ptr
= version_string
;
40 unsigned major
, minor
= 0;
44 while (*ptr
&& *ptr
!= '.')
47 minor
= atoi (ptr
+ 1);
55 v
[0] = (major
< 10 ? '0' : 'A' - 10) + major
;
56 v
[1] = (minor
/ 10) + '0';
57 v
[2] = (minor
% 10) + '0';
60 for (ix
= 0; ix
!= 4; ix
++)
61 version
= (version
<< 8) | v
[ix
];
63 printf ("/* Generated automatically by the program `%s'\n", argv
[0]);
64 printf (" from `%s'. */\n", version_string
);
66 printf ("#define GCOV_VERSION ((unsigned)%#08x) /* %.4s */\n",