VirtualBox

Changeset 24842 in vbox for trunk/include


Ignore:
Timestamp:
Nov 21, 2009 9:56:51 PM (15 years ago)
Author:
vboxsync
Message:

VBox/version.h: Added VBOX_FULL_VERSION which includes all three version components together with a maker and the three getters. (#4480)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/version.h

    r21217 r24842  
    3737# define VBOX_VERSION                    (VBOX_VERSION_MAJOR << 16 | VBOX_VERSION_MINOR)
    3838/** Get minor version from combined version */
    39 # define VBOX_GET_VERSION_MINOR(uVer)    (uVer & 0xffff)
     39# define VBOX_GET_VERSION_MINOR(uVer)    ((uVer) & 0xffff)
    4040/** Get major version from combined version. */
    41 # define VBOX_GET_VERSION_MAJOR(uVer)    (uVer >> 16)
     41# define VBOX_GET_VERSION_MAJOR(uVer)    ((uVer) >> 16)
     42
     43/**
     44 * Make a full version number.
     45 *
     46 * The returned number can be used in normal integer comparsions and will yield
     47 * the expected results.
     48 *
     49 * @param   uMajor      The major version nu.ber
     50 * @param   uMinor      The minor version number.
     51 * @param   uBuild      The build number.
     52 * @returns Full version number.
     53 */
     54# define VBOX_FULL_VERSION_MAKE(uMajor, uMinor, uBuild) \
     55    (  (uint32_t)((uMajor) &   0xff) << 24 \
     56     | (uint32_t)((uMinor) &   0xff) << 16 \
     57     | (uint32_t)((uMinor) & 0xffff)       \
     58    )
     59
     60/** Combined version number. */
     61# define VBOX_FULL_VERSION              \
     62    VBOX_FULL_VERSION_MAKE(VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, VBOX_VERSION_BUILD)
     63/** Get the major version number from a VBOX_FULL_VERSION style number. */
     64# define VBOX_FULL_VERSION_GET_MAJOR(uFullVer)  ( ((uFullVer) >> 24) &   0xffU )
     65/** Get the minor version number from a VBOX_FULL_VERSION style number. */
     66# define VBOX_FULL_VERSION_GET_MINOR(uFullVer)  ( ((uFullVer) >> 16) &   0xffU )
     67/** Get the build version number from a VBOX_FULL_VERSION style number. */
     68# define VBOX_FULL_VERSION_GET_BUILD(uFullVer)  ( ((uFullVer)      ) & 0xffffU )
     69
    4270#endif /* !RC_INVOKED */
    4371
     
    4573#define VBOX_VENDOR                     "Sun Microsystems, Inc."
    4674
    47 /** Prefined strings for Windows resource files */
     75/** @name Prefined strings for Windows resource files
     76 *
     77 * @remarks The VBOX_VERSION_*_NR define are integer numbers while
     78 *          VBOX_VERSION_* are strings when using the resource compile.
     79 *          Kind of confusing...
     80 *
     81 * @{ */
    4882#define VBOX_RC_COMPANY_NAME            VBOX_VENDOR
    4983#define VBOX_RC_LEGAL_COPYRIGHT         "Copyright (C) 2009 Sun Microsystems, Inc.\0"
    5084#define VBOX_RC_PRODUCT_VERSION         VBOX_VERSION_MAJOR_NR , VBOX_VERSION_MINOR_NR , 0 , 0
    5185#define VBOX_RC_FILE_VERSION            VBOX_VERSION_MAJOR_NR , VBOX_VERSION_MINOR_NR , 0 , 0
     86/** @} */
    5287
    5388#endif
Note: See TracChangeset for help on using the changeset viewer.

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