VirtualBox

source: vbox/trunk/include/VBox/version.h@ 104125

Last change on this file since 104125 was 98103, checked in by vboxsync, 22 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.4 KB
Line 
1/** @file
2 * VBox Version Management.
3 */
4
5/*
6 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef VBOX_INCLUDED_version_h
37#define VBOX_INCLUDED_version_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42/* Product info. */
43#include <product-generated.h>
44#include <version-generated.h>
45
46#ifdef RC_INVOKED
47/* Some versions of RC has trouble with cdefs.h, so we duplicate these two here. */
48# define RT_STR(str) #str
49# define RT_XSTR(str) RT_STR(str)
50#else /* !RC_INVOKED */
51
52/** Combined version number. */
53# define VBOX_VERSION (VBOX_VERSION_MAJOR << 16 | VBOX_VERSION_MINOR)
54/** Get minor version from combined version. */
55# define VBOX_GET_VERSION_MINOR(uVer) ((uVer) & 0xffff)
56/** Get major version from combined version. */
57# define VBOX_GET_VERSION_MAJOR(uVer) ((uVer) >> 16)
58
59/**
60 * Make a full version number.
61 *
62 * The returned number can be used in normal integer comparsions and will yield
63 * the expected results.
64 *
65 * @param uMajor The major version number.
66 * @param uMinor The minor version number.
67 * @param uBuild The build number.
68 * @returns Full version number.
69 */
70# define VBOX_FULL_VERSION_MAKE(uMajor, uMinor, uBuild) \
71 ( (uint32_t)((uMajor) & 0xff) << 24 \
72 | (uint32_t)((uMinor) & 0xff) << 16 \
73 | (uint32_t)((uBuild) & 0xffff) \
74 )
75
76/** Combined version number. */
77# define VBOX_FULL_VERSION \
78 VBOX_FULL_VERSION_MAKE(VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD)
79/** Get the major version number from a VBOX_FULL_VERSION style number. */
80# define VBOX_FULL_VERSION_GET_MAJOR(uFullVer) ( ((uFullVer) >> 24) & 0xffU )
81/** Get the minor version number from a VBOX_FULL_VERSION style number. */
82# define VBOX_FULL_VERSION_GET_MINOR(uFullVer) ( ((uFullVer) >> 16) & 0xffU )
83/** Get the build version number from a VBOX_FULL_VERSION style number. */
84# define VBOX_FULL_VERSION_GET_BUILD(uFullVer) ( ((uFullVer) ) & 0xffffU )
85
86/**
87 * Make a short version number for use in 16 bit version fields.
88 *
89 * The returned number can be used in normal integer comparsions and will yield
90 * the expected results.
91 *
92 * @param uMajor The major version number.
93 * @param uMinor The minor version number.
94 * @returns Short version number.
95 */
96# define VBOX_SHORT_VERSION_MAKE(uMajor, uMinor) \
97 ( (uint16_t)((uMajor) & 0xff) << 8 \
98 | (uint16_t)((uMinor) & 0xff) \
99 )
100
101/** Combined short version number. */
102# define VBOX_SHORT_VERSION \
103 VBOX_SHORT_VERSION_MAKE(VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR)
104/** Get the major version number from a VBOX_SHORT_VERSION style number. */
105# define VBOX_SHORT_VERSION_GET_MAJOR(uShortVer) ( ((uShortVer) >> 8) & 0xffU )
106/** Get the minor version number from a VBOX_SHORT_VERSION style number. */
107# define VBOX_SHORT_VERSION_GET_MINOR(uShortVer) ( (uShortVer) & 0xffU )
108
109#endif /* !RC_INVOKED */
110
111/** @name Prefined strings for Windows resource files
112 * @{ */
113#define VBOX_RC_COMPANY_NAME VBOX_VENDOR
114#define VBOX_RC_LEGAL_COPYRIGHT "Copyright (C) 2009-" VBOX_C_YEAR " Oracle Corporation\0"
115#define VBOX_RC_PRODUCT_NAME VBOX_PRODUCT
116#define VBOX_RC_PRODUCT_NAME_GA VBOX_PRODUCT " Guest Additions"
117#define VBOX_RC_PRODUCT_NAME_PUEL_EXTPACK VBOX_PRODUCT " Extension Pack"
118#define VBOX_RC_PRODUCT_NAME_DTRACE_EXTPACK VBOX_PRODUCT " VBoxDTrace Extension Pack"
119#define VBOX_RC_PRODUCT_NAME_STR VBOX_RC_PRODUCT_NAME "\0"
120#define VBOX_RC_PRODUCT_NAME_GA_STR VBOX_RC_PRODUCT_NAME_GA "\0"
121#define VBOX_RC_PRODUCT_NAME_PUEL_EXTPACK_STR VBOX_RC_PRODUCT_NAME_PUEL_EXTPACK "\0"
122#define VBOX_RC_PRODUCT_NAME_DTRACE_EXTPACK_STR VBOX_RC_PRODUCT_NAME_DTRACE_EXTPACK "\0"
123#define VBOX_RC_PRODUCT_VERSION VBOX_VERSION_MAJOR , VBOX_VERSION_MINOR , VBOX_VERSION_BUILD , VBOX_SVN_REV_MOD_5K
124#define VBOX_RC_FILE_VERSION VBOX_VERSION_MAJOR , VBOX_VERSION_MINOR , VBOX_VERSION_BUILD , VBOX_SVN_REV_MOD_5K
125#ifndef VBOX_VERSION_PRERELEASE
126# define VBOX_RC_PRODUCT_VERSION_STR RT_XSTR(VBOX_VERSION_MAJOR) "." RT_XSTR(VBOX_VERSION_MINOR) "." RT_XSTR(VBOX_VERSION_BUILD) "." RT_XSTR(VBOX_SVN_REV) "\0"
127# define VBOX_RC_FILE_VERSION_STR RT_XSTR(VBOX_VERSION_MAJOR) "." RT_XSTR(VBOX_VERSION_MINOR) "." RT_XSTR(VBOX_VERSION_BUILD) "." RT_XSTR(VBOX_SVN_REV) "\0"
128#else
129# define VBOX_RC_PRODUCT_VERSION_STR RT_XSTR(VBOX_VERSION_MAJOR) "." RT_XSTR(VBOX_VERSION_MINOR) "." RT_XSTR(VBOX_VERSION_BUILD) "." RT_XSTR(VBOX_SVN_REV) " (" VBOX_VERSION_PRERELEASE ")\0"
130# define VBOX_RC_FILE_VERSION_STR RT_XSTR(VBOX_VERSION_MAJOR) "." RT_XSTR(VBOX_VERSION_MINOR) "." RT_XSTR(VBOX_VERSION_BUILD) "." RT_XSTR(VBOX_SVN_REV) " (" VBOX_VERSION_PRERELEASE ")\0"
131#endif
132#define VBOX_RC_FILE_OS VOS_NT_WINDOWS32
133#define VBOX_RC_TYPE_DLL VFT_DLL
134#define VBOX_RC_TYPE_APP VFT_APP
135#define VBOX_RC_TYPE_DRV VFT_DRV
136/* Flags and extra strings depending on the build type and who's building. */
137#if defined(DEBUG) || defined(LOG_ENABLED) || defined(RT_STRICT) || defined(VBOX_STRICT) || defined(VBOX_WITH_STATISTICS)
138# define VBOX_RC_FILE_FLAGS_DEBUG VS_FF_DEBUG
139#else
140# define VBOX_RC_FILE_FLAGS_DEBUG 0
141#endif
142#if VBOX_VERSION_MINOR >= 51 || defined(VBOX_VERSION_PRERELEASE)
143# define VBOX_RC_FILE_FLAGS_PRERELEASE VS_FF_PRERELEASE
144#else
145# define VBOX_RC_FILE_FLAGS_PRERELEASE 0
146#endif
147#if defined(VBOX_BUILD_SERVER_BUILD) && (VBOX_VERSION_MINOR & 1) == 0
148# define VBOX_RC_FILE_FLAGS_BUILD 0
149# define VBOX_RC_MORE_STRINGS
150#elif defined(VBOX_BUILD_SERVER_BUILD)
151# define VBOX_RC_FILE_FLAGS_BUILD VS_FF_SPECIALBUILD
152# define VBOX_RC_MORE_STRINGS VALUE "SpecialBuild", "r" RT_XSTR(VBOX_SVN_REV) "\0"
153#else
154# define VBOX_RC_FILE_FLAGS_BUILD VS_FF_PRIVATEBUILD
155# ifdef VBOX_PRIVATE_BUILD_DESC
156# define VBOX_RC_MORE_STRINGS VALUE "PrivateBuild", VBOX_PRIVATE_BUILD_DESC "\0"
157# else
158# define VBOX_RC_MORE_STRINGS VALUE "PrivateBuild", "r" RT_XSTR(VBOX_SVN_REV) "\0"
159# error
160# endif
161#endif
162#define VBOX_RC_FILE_FLAGS (VBOX_RC_FILE_FLAGS_DEBUG | VBOX_RC_FILE_FLAGS_PRERELEASE | VBOX_RC_FILE_FLAGS_BUILD)
163/** @} */
164
165#endif /* !VBOX_INCLUDED_version_h */
166
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette