VirtualBox

Changeset 85703 in vbox for trunk/include


Ignore:
Timestamp:
Aug 11, 2020 6:54:01 PM (4 years ago)
Author:
vboxsync
Message:

IPRT,lnx-kmods: s/RTLNX_RHEL_PREREQ/RTLNX_RHEL_MIN/; added RTLNX_RHEL_MAX and RTLNX_RHEL_RANGE. Use them instead of the RHEL_XXXX defines everywhere.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/linux/version.h

    r85702 r85703  
    5353
    5454
    55 /** @def RTLNX_RHEL_PREREQ
     55/** @def RTLNX_RHEL_MIN
    5656 * Require a minium RedHat release.
    5757 * @param a_iMajor      The major release number (RHEL_MAJOR).
    5858 * @param a_iMinor      The minor release number (RHEL_MINOR).
    59  * @sa RTLNX_RHEL_MAJ_PREREQ
     59 * @sa RTLNX_RHEL_MAX, RTLNX_RHEL_RANGE, RTLNX_RHEL_MAJ_PREREQ
    6060 */
    6161#if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
    62 # define RTLNX_RHEL_PREREQ(a_iMajor, a_iMinor) \
     62# define RTLNX_RHEL_MIN(a_iMajor, a_iMinor) \
    6363     ((RHEL_MAJOR) > (a_iMajor) || ((RHEL_MAJOR) == (a_iMajor) && (RHEL_MINOR) >= (a_iMinor)))
    6464#else
    65 # define RTLNX_RHEL_PREREQ(a_iMajor, a_iMinor) (0)
     65# define RTLNX_RHEL_MIN(a_iMajor, a_iMinor) (0)
     66#endif
     67
     68/** @def RTLNX_RHEL_MAX
     69 * Require a maximum RedHat release, true for all RHEL versions below it.
     70 * @param a_iMajor      The major release number (RHEL_MAJOR).
     71 * @param a_iMinor      The minor release number (RHEL_MINOR).
     72 * @sa RTLNX_RHEL_MIN, RTLNX_RHEL_RANGE, RTLNX_RHEL_MAJ_PREREQ
     73 */
     74#if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
     75# define RTLNX_RHEL_MAX(a_iMajor, a_iMinor) \
     76     ((RHEL_MAJOR) < (a_iMajor) || ((RHEL_MAJOR) == (a_iMajor) && (RHEL_MINOR) < (a_iMinor)))
     77#else
     78# define RTLNX_RHEL_MAX(a_iMajor, a_iMinor) (0)
     79#endif
     80
     81/** @define RTLNX_RHEL_RANGE
     82 * Check that it's a RedHat kernel in the given version range.
     83 * The max version is exclusive, the minimum inclusive.
     84 * @sa RTLNX_RHEL_MIN, RTLNX_RHEL_MAX, RTLNX_RHEL_MAJ_PREREQ
     85 */
     86#if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
     87# define RTLNX_RHEL_RANGE(a_iMajorMin, a_iMinorMin,  a_iMajorMax, a_iMinorMax) \
     88     (RTLNX_RHEL_MIN(a_iMajorMin, a_iMinorMin) && RTLNX_RHEL_MAX(a_iMajorMax, a_iMinorMax))
     89#else
     90# define RTLNX_RHEL_RANGE(a_iMajorMin, a_iMinorMin,  a_iMajorMax, a_iMinorMax)  (0)
    6691#endif
    6792
     
    7095 * @param a_iMajor      RHEL_MAJOR must _equal_ this.
    7196 * @param a_iMinor      RHEL_MINOR must be greater or equal to this.
    72  * @sa RTLNX_RHEL_PREREQ
     97 * @sa RTLNX_RHEL_MIN, RTLNX_RHEL_MAX
    7398 */
    7499#if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
     
    77102# define RTLNX_RHEL_MAJ_PREREQ(a_iMajor, a_iMinor) (0)
    78103#endif
     104
    79105
    80106/** @def RTLNX_SUSE_MAJ_PREREQ
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