Pull strict-aliasing fix for sockaddr_46.
[exim.git] / src / src / version.c
CommitLineData
059ec3d9
PH
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
0a49a7a4 5/* Copyright (c) University of Cambridge 1995 - 2009 */
059ec3d9
PH
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* Function for setting up the version string. */
9
10#include "exim.h"
11
6545de78 12#include "version.h"
059ec3d9
PH
13
14
15/* The header file cnumber.h contains a single line containing the
16compilation number, making it easy to have it updated automatically.
17Hence the fudgery below to get the number turned into a string, since
18we can't use #include inside a macro argument list */
19
20void
21version_init(void)
22{
23static uschar cnumber_buffer[24];
24static uschar date_buffer[32];
25
26uschar today[20];
27uschar *version_cnumber_format;
28
29int cnumber =
30#include "cnumber.h"
31;
32
33/* The odd magic after each of these is so they can be easily found
34for automatic patching to standard values when running regression tests.
35The reason that version_cnumber_format isn't just written inline in the
36sprintf() call is the gcc -Wall warns about a \0 in a format string. */
37
38version_cnumber = cnumber_buffer;
39version_cnumber_format = US"%d\0<<eximcnumber>>";
40sprintf(CS version_cnumber, CS version_cnumber_format, cnumber);
6545de78 41version_string = US EXIM_VERSION_STR "\0<<eximversion>>";
059ec3d9
PH
42
43Ustrcpy(today, __DATE__);
44if (today[4] == ' ') today[4] = '0';
45today[3] = today[6] = '-';
46
47version_date = date_buffer;
48version_date[0] = 0;
49Ustrncat(version_date, today+4, 3);
50Ustrncat(version_date, today, 4);
51Ustrncat(version_date, today+7, 4);
52Ustrcat(version_date, " ");
53Ustrcat(version_date, __TIME__);
54}
55
56/* End of version.c */