forked from yath/cvsnt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version_fu.h
230 lines (206 loc) · 8.85 KB
/
version_fu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/*
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 1, or (at your option)
** any later version.
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Author : Jonathan M. Gilligan <jonathan.gilligan@vanderbilt.edu> --- 23 June 2001
*/
/*
* version_fu.h -- Macros used for version numbering
*/
#ifndef VERSION_FU__H
#define VERSION_FU__H
#ifdef _WIN32
#pragma warning(disable:4003)
#endif
//////////////////////////////////////////////////////////////////////////
// Documentation
//
// The macros below generate a number of strings that describe aspects of
// the current build.
//
// Principal aspects include a number of MS-specified flags:
//
// Debug build: Self-explanatory.
//
// Private Build: A non-standard build. We use the private build
// flag to indicate that the build was not an
// ` official release. As checked out with CVS, the
// sources are set up to build as a private build.
//
//
// Special Build: Some other kind of non-standard build. We do not
// currently define special builds, but the plumbing
// is in place in version_fu to handle special builds
// if the flag CVSNT_SPECIAL_BUILD is defined.
//
//
// Strings and other macros generated by version_fu:
//
// CVSNT_PRODUCTVERSION: Version tokens to be used in the VERSION_INFO
// resource. These tokens have the form x,x,x,x where
// x is a decimal number indicating
// major,minor,patch,build.
//
// File version refers to the specific executable file
// (cvs.exe). Product version refers to the cvsnt package
// as a whole.
//
// CVSNT_PRODUCTVERSION_STRING: Double-quoted string equivalents of the
// above. The format is:
// "N x.x.x.x r (s p u d Build x)",
// Where
// N = name (of file or product)
// x.x.x.x = major.minor.patchlevel.build,
// r = prerelease build string,
// s = special build string,
// p = private build string,
// d = debug build string.
//
// Example:
// "cvsnt 1.11.0.7 Beta 2 (Special Private Unicode Debug Build 7)"
//
// CVSNT_PATCHED_FLAG,
// CVSNT_SPECIAL_BUILD_FLAG,
// CVSNT_PRIVATE_BUILD_FLAG,
// CVSNT_DEBUG_BUILD_FLAG: These are flags (numbers, which can be OR'ed together
// for the FILEFLAGS member of VERSION_INFO.
//
// CVSNT_DEBUG_BUILD,
// CVSNT_SPECIAL_BUILD,
// CVSNT_PRIVATE_BUILD,
// These are strings (ending with
// a space) that can be concatenated together
// to produce a description of the various
// build conditions.
//
// The order these fields appear in the File
// Description and Product Description fields of
// VERSION_INFO are: PRERELEASE, PRIVATE, SPECIAL,
// UNICODE, and DEBUG.
//
//
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Preprocessor definitions (for version_no.h)
//
// Preprocessor flags (empty #defines):
// These should be #defined in version_no.h
//
//
// Preprocessor values (#defines with contents):
// These should be #defined in version_no.h
//
// CVSNT_PRODUCT_MAJOR,
// CVSNT_PRODUCT_MINOR,
// CVSNT_PRODUCT_PATCHLEVEL:
// CVSNT_PRODUCT_BUILD:
//
// These macros all indicate parts of the version
// number. *FILE* indicates specific numbers for the
// .exe files (cvs.exe, cvs95.exe). The *PRODUCT*
// numbers indicate the version of the package as a
// whole.
//
// At this time, cvs.exe is at version 1.11.0
// (cvs 1.11.0).
//
// EXAMPLE:
//
// #define CVSNT_PRODUCT_MAJOR 1
// #define CVSNT_PRODUCT_MINOR 11
// #define CVSNT_PRODUCT_PATCHLEVEL 0
//
//
//
// CVSNT_SPECIAL_BUILD,
// CVSNT_PRIVATE_BUILD: These should be #defined to a double-quoted
// string that will be used to create a prefix for
// the build description string. E.g., the following:
//
// #define CVSNT_SPECIAL_BUILD "anomalous"
// #define CVSNT_PRIVATE_BUILD "in house"
//
// Will produce the text "in house anomalous build"
// in the file and product description strings,
// "anomalous build" in the Special Build Description
// string, and "in house build" in the Private Build
// string in the VERSION_INFO resource.
//
// All other necessary preprocessor definitions are synthesized by
// version_fu.h
//
//////////////////////////////////////////////////////////////////////////
#define CVSNT_SPECIAL_BUILD "Suite" // {Z} - Remove nags
//////////////////////////////////////////////////////////////////////////
// We need two macros because token expansion occurs when PP_STRINGIZE
// expands x when passing it to .
#define PP_A(x) #x
#define PP_W(x) L#x
#define PP_STRINGIZE_A(x) PP_A(x)
#define PP_STRINGIZE_W(x) PP_W(x)
#define _A(x) x
#define __W(x) L ## x
#define _W(x) __W(x)
#define CVSNT_PRODUCTVERSION CVSNT_PRODUCT_MAJOR,CVSNT_PRODUCT_MINOR,CVSNT_PRODUCT_PATCHLEVEL,CVSNT_PRODUCT_BUILD
#if defined(CVSNT_PATCH)
#define CVSNT_PATCHED_FLAG VS_FF_PATCHED
#else // defined(CVSNT_PATCH)
#define CVSNT_PATCHED_FLAG 0
#endif // defined(CVSNT_PATCH)
#if defined(CVSNT_SPECIAL_BUILD)
#define CVSNT_SPECIAL_BUILD_FLAG VS_FF_SPECIALBUILD
#define CVSNT_BRACKET_LEFT " ("
#define CVSNT_BRACKET_RIGHT ")"
#else // defined(CVSNT_SPECIAL_BUILD)
#define CVSNT_SPECIAL_BUILD ""
#define CVSNT_SPECIAL_BUILD_FLAG 0
#endif // defined(CVSNT_SPECIAL_BUILD)
#if defined(CVSNT_PRIVATE_BUILD)
#define CVSNT_BRACKET_LEFT " ("
#define CVSNT_BRACKET_RIGHT ")"
#define CVSNT_PRIVATE_BUILD_FLAG VS_FF_PRIVATEBUILD
#else // defined(CVSNT_PRIVATE_BUILD)
#define CVSNT_PRIVATE_BUILD ""
#define CVSNT_PRIVATE_BUILD_FLAG 0
#endif // defined(CVSNT_PRIVATE_BUILD)
#if defined(_DEBUG)
#define CVSNT_DEBUG_FLAG VS_FF_DEBUG
#define CVSNT_DEBUG_BUILD "Debug "
#define CVSNT_BRACKET_LEFT " ("
#define CVSNT_BRACKET_RIGHT ")"
#else // defined(_DEBUG)
#define CVSNT_DEBUG_BUILD ""
#define CVSNT_DEBUG_FLAG 0
#endif // defined(_DEBUG)
#ifndef CVSNT_BRACKET_LEFT
#define CVSNT_BRACKET_LEFT ""
#define CVSNT_BRACKET_RIGHT ""
#endif
//
// Resource Compiler chokes if we break these long lines with line continuation characters '\'
//
#define CVSNT_PRODUCTVERSION_STRING_A PP_STRINGIZE_A(CVSNT_PRODUCT_MAJOR.CVSNT_PRODUCT_MINOR.CVSNT_PRODUCT_PATCHLEVEL) _A(CVSNT_PRODUCT_NAME) _A(" Build ") PP_STRINGIZE_A(CVSNT_PRODUCT_BUILD) _A(CVSNT_BRACKET_LEFT) _A(CVSNT_DEBUG_BUILD) _A(CVSNT_SPECIAL_BUILD) _A(CVSNT_PRIVATE_BUILD) _A(CVSNT_BRACKET_RIGHT)
#define CVSNT_PRODUCTVERSION_SHORT_A PP_STRINGIZE_A(CVSNT_PRODUCT_MAJOR.CVSNT_PRODUCT_MINOR.CVSNT_PRODUCT_PATCHLEVEL.CVSNT_PRODUCT_BUILD)
#define CVSNT_PRODUCTVERSION_STRING_W PP_STRINGIZE_W(CVSNT_PRODUCT_MAJOR.CVSNT_PRODUCT_MINOR.CVSNT_PRODUCT_PATCHLEVEL) _W(CVSNT_PRODUCT_NAME) _W(" Build ") PP_STRINGIZE_W(CVSNT_PRODUCT_BUILD) _W(CVSNT_BRACKET_LEFT) _W(CVSNT_DEBUG_BUILD) _W(CVSNT_SPECIAL_BUILD) _W(CVSNT_PRIVATE_BUILD) _W(CVSNT_BRACKET_RIGHT)
#define CVSNT_PRODUCTVERSION_SHORT_W PP_STRINGIZE_W(CVSNT_PRODUCT_MAJOR.CVSNT_PRODUCT_MINOR.CVSNT_PRODUCT_PATCHLEVEL.CVSNT_PRODUCT_BUILD)
#define CVSNT_FILEVERSION CVSNT_PRODUCT_MAJOR,CVSNT_PRODUCT_MINOR,CVSNT_PRODUCT_PATCHLEVEL,CVSNT_PRODUCT_BUILD
#define CVSNT_PRODUCTVERSION_STRING CVSNT_PRODUCTVERSION_STRING_A
#define CVSNT_PRODUCTVERSION_SHORT CVSNT_PRODUCTVERSION_SHORT_A
#ifdef _UNICODE
#define CVSNT_PRODUCTVERSION_STRING_T CVSNT_PRODUCTVERSION_STRING_W
#define CVSNT_PRODUCTVERSION_SHORT_T CVSNT_PRODUCTVERSION_SHORT_W
#else
#define CVSNT_PRODUCTVERSION_STRING_T CVSNT_PRODUCTVERSION_STRING_A
#define CVSNT_PRODUCTVERSION_SHORT_T CVSNT_PRODUCTVERSION_SHORT_A
#endif
#endif