VirtualBox

Changeset 38719 in vbox for trunk/include


Ignore:
Timestamp:
Sep 13, 2011 6:19:00 AM (13 years ago)
Author:
vboxsync
Message:

version.h: add VBOX_SHORT_VERSION which fits in 16bits

File:
1 edited

Legend:

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

    r35687 r38719  
    6767# define VBOX_FULL_VERSION_GET_BUILD(uFullVer)  ( ((uFullVer)      ) & 0xffffU )
    6868
     69/**
     70 * Make a short version number for use in 16 bit version fields.
     71 *
     72 * The returned number can be used in normal integer comparsions and will yield
     73 * the expected results.
     74 *
     75 * @param   uMajor      The major version number.
     76 * @param   uMinor      The minor version number.
     77 * @returns Short version number.
     78 */
     79# define VBOX_SHORT_VERSION_MAKE(uMajor, uMinor) \
     80    (  (uint16_t)((uMajor) &   0xff) << 8 \
     81     | (uint16_t)((uMinor) &   0xff)      \
     82    )
     83
     84/** Combined short version number. */
     85# define VBOX_SHORT_VERSION               \
     86    VBOX_SHORT_VERSION_MAKE(VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR)
     87/** Get the major version number from a VBOX_SHORT_VERSION style number. */
     88# define VBOX_SHORT_VERSION_GET_MAJOR(uShortVer)  ( ((uShortVer) >> 8) &   0xffU )
     89/** Get the minor version number from a VBOX_SHORT_VERSION style number. */
     90# define VBOX_SHORT_VERSION_GET_MINOR(uShortVer)  ( (uShortVer) &   0xffU )
     91
    6992#endif /* !RC_INVOKED */
    7093
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