xref: /aoo41x/main/solenv/inc/verinfo.hrc (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef _VERINFO_HRC
29#define _VERINFO_HRC
30
31// include ---------------------------------------------------------------
32
33#ifndef WIN32
34#include <ver.h>
35#else
36#include <winver.h>
37#endif
38
39// general preprocessor string management --------------------------------
40
41#ifndef PPSX
42#define PPSX(s) #s
43#endif
44#ifndef PPS
45#define PPS(s) PPSX(s)
46#endif
47
48#ifndef PPCX
49#define PPCX(s1, s2) s1##s2
50#endif
51#ifndef PPCAT
52#define PPCAT(s1, s2) PPCX(s1, s2)
53#endif
54
55// define order of date parts --------------------------------------------
56
57#if defined(LG_D)
58  #define VER_DMY
59#else
60  #define VER_YMD
61#endif
62
63// set VERVARIANT to 0 if not defined ------------------------------------
64
65#if !defined(VERVARIANT)
66  #define VERVARIANT 0
67#endif
68
69// define pre release state ----------------------------------------------
70
71#ifdef VER_CONCEPT
72  #define VER_PREL 1
73  #define VER_COUNT (0+VER_CONCEPT)
74  #define VER1 Concept (Level VER_CONCEPT)
75#endif
76
77#ifdef VER_ALPHA
78  #define VER_PREL 1
79  #define VER_COUNT (100+VER_ALPHA)
80  #define VER1 Alpha (Level VER_ALPHA)
81#endif
82
83#ifdef VER_BETA
84  #define VER_PREL 1
85  #define VER_COUNT (200+VER_BETA)
86  #define VER1 Beta (Level VER_BETA)
87#endif
88
89#ifdef VER_GAMMA
90  #define VER_PREL 1
91  #define VER_COUNT (300+VER_GAMMA)
92  #define VER1 Gamma (Level VER_GAMMA)
93#endif
94
95#ifdef VER_FINAL
96  #define VER_COUNT (500+VER_FINAL)
97  #if VER_FINAL==0
98    #undef VER1
99  #elif VER_FINAL==1
100    #define VER1 1
101  #elif VER_FINAL==2
102    #define VER1 2
103  #elif VER_FINAL==3
104    #define VER1 3
105  #elif VER_FINAL==4
106    #define VER1 4
107  #elif VER_FINAL==5
108    #define VER1 5
109  #elif VER_FINAL==6
110    #define VER1 6
111  #elif VER_FINAL==7
112    #define VER1 7
113  #elif VER_FINAL==8
114    #define VER1 8
115  #elif VER_FINAL==9
116    #define VER1 9
117  #elif VER_FINAL==10
118    #define VER1 a
119  #elif VER_FINAL==11
120    #define VER1 b
121  #elif VER_FINAL==12
122    #define VER1 c
123  #endif
124#endif
125
126#ifdef SUBVERSION
127#if SUBVERSION < 10
128  #define VER4 PPCAT(0, SUBVERSION)
129#else
130  #define VER4 SUBVERSION
131#endif
132#else
133  #define VER4 0.0
134#endif
135
136#ifndef VER1
137#if VERVARIANT > 0
138  #define VER_LEVEL VERSION.VER4.VERVARIANT
139#else
140  #define VER_LEVEL VERSION.VER4
141#endif
142#else
143  #define VERC1(a, b, c) a.b##c
144  #define VERC2(a, b, c) VERC1(a, b, c)
145  #define VER_LEVEL VERC2(VERSION, VER4, VER1)
146#endif
147
148#if !defined(VER_DMY) && VER_DAY < 10
149  #define VER5 PPCAT(0, VER_DAY)
150#else
151  #define VER5 VER_DAY
152#endif
153
154// define month strings --------------------------------------------------
155
156#if VER_MONTH==1
157  #define VER2 Jan
158#elif VER_MONTH==2
159  #define VER2 Feb
160#elif VER_MONTH==3
161  #ifdef LG_D
162    #define VER2 M\344r
163  #else
164    #define VER2 Mar
165  #endif
166#elif VER_MONTH==4
167  #define VER2 Apr
168#elif VER_MONTH==5
169  #ifdef LG_D
170    #define VER2 Mai
171  #else
172    #define VER2 May
173  #endif
174#elif VER_MONTH==6
175  #define VER2 Jun
176#elif VER_MONTH==7
177  #define VER2 Jul
178#elif VER_MONTH==8
179  #define VER2 Aug
180#elif VER_MONTH==9
181  #define VER2 Sep
182#elif VER_MONTH==10
183  #ifdef LG_D
184    #define VER2 Okt
185  #else
186    #define VER2 Oct
187  #endif
188#elif VER_MONTH==11
189  #define VER2 Nov
190#elif VER_MONTH==12
191  #ifdef LG_D
192    #define VER2 Dez
193  #else
194    #define VER2 Dec
195  #endif
196#endif
197
198#ifdef LG_D
199  #define VERC3(a, b, c) a.b.c
200#else
201  #define VERC3(a, b, c) c-b-a
202#endif
203#define VERC4(a, b, c) VERC3(a, b, c)
204#define VER_DATE VERC4(VER5, VER2, VER_YEAR)
205
206#if PPCAT(1, VER_FIRSTYEAR)==PPCAT(1, VER_YEAR)
207  #define VER_YEARRANGE VER_FIRSTYEAR
208#else
209  #define VER_YEARRANGE VER_FIRSTYEAR-VER_YEAR
210#endif
211
212#if VER_FIRSTYEAR > 100
213#define VERC5(a) Copyright \251 a by
214#define VERC6(a) VERC5(a)
215#else
216#define VERC5(a) Copyright \251 20##a by
217#define VERC6(a) VERC5(a)
218#endif
219
220#define S_CRIGHT PPS(VERC6(VER_YEARRANGE))
221
222#ifdef LG_D
223#define S_VERSION PPS(Version VER_LEVEL vom VER_DATE)
224#else
225#define S_VERSION PPS(Version VER_LEVEL of VER_DATE)
226#endif
227
228#endif	// _VERINFO_HRC
229
230