VirtualBox

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

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