VirtualBox

Changeset 74793 in vbox


Ignore:
Timestamp:
Oct 12, 2018 10:58:34 AM (6 years ago)
Author:
vboxsync
Message:

vm.h: No need to use lambda for set and clear macros. bugref:9180

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/vm.h

    r74792 r74793  
    625625 * @param   fFlag   The flag to set.
    626626 */
    627 #if 1
    628 # if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
    629 #  define VM_FF_SET(pVM, fFlag)              ASMAtomicOrU32(&(pVM)->fGlobalForcedActions, (fFlag))
    630 # else
    631 #  define VM_FF_SET(pVM, fFlag) \
    632     ([](PVM a_pVM) -> void \
    633     { \
    634         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
    635         ASMAtomicOrU32(&a_pVM->fGlobalForcedActions, (fFlag)); \
    636     }(pVM))
    637 # endif
    638 #else
    639 # define VM_FF_SET(pVM, fFlag) \
    640     do { ASMAtomicOrU32(&(pVM)->fGlobalForcedActions, (fFlag)); \
    641          RTLogPrintf("VM_FF_SET  : %08x %s - %s(%d) %s\n", (pVM)->fGlobalForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
    642     } while (0)
    643 #endif
     627#define VM_FF_SET(pVM, fFlag) \
     628    do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicOrU32(&(pVM)->fGlobalForcedActions, (fFlag)); } while (0)
    644629
    645630/** @def VMCPU_FF_SET
     
    650635 * @sa      VMCPU_FF_SET_MASK
    651636 */
    652 #if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
    653 # define VMCPU_FF_SET(pVCpu, fFlag)          ASMAtomicOrU32(&(pVCpu)->fLocalForcedActions, (fFlag))
    654 #else
    655 # define VMCPU_FF_SET(pVCpu, fFlag) \
    656     ([](PVMCPU a_pVCpu) -> void \
    657     { \
    658         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
    659         ASMAtomicOrU32(&a_pVCpu->fLocalForcedActions, (fFlag)); \
    660     }(pVCpu))
    661 #endif
     637#define VMCPU_FF_SET(pVCpu, fFlag) \
     638    do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicOrU32(&(pVCpu)->fLocalForcedActions, (fFlag)); } while (0)
    662639
    663640/** @def VMCPU_FF_SET
     
    668645 * @sa      VMCPU_FF_SET
    669646 */
    670 #define VMCPU_FF_SET_MASK(a_pVCpu, fFlags)  ASMAtomicOrU32(&a_pVCpu->fLocalForcedActions, (fFlags))
     647#define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) \
     648    do { ASMAtomicOrU32(&a_pVCpu->fLocalForcedActions, (fFlags)); } while (0)
    671649
    672650/** @def VM_FF_CLEAR
     
    676654 * @param   fFlag   The flag to clear.
    677655 */
    678 #if 1
    679 # if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
    680 #  define VM_FF_CLEAR(pVM, fFlag)            ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag))
    681 # else
    682 #  define VM_FF_CLEAR(pVM, fFlag) \
    683     ([](PVM a_pVM) -> void \
    684     { \
    685         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
    686         ASMAtomicAndU32(&a_pVM->fGlobalForcedActions, ~(fFlag)); \
    687     }(pVM))
    688 # endif
    689 #else
    690 # define VM_FF_CLEAR(pVM, fFlag) \
    691     do { ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag)); \
    692          RTLogPrintf("VM_FF_CLEAR: %08x %s - %s(%d) %s\n", (pVM)->fGlobalForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
    693     } while (0)
    694 #endif
     656#define VM_FF_CLEAR(pVM, fFlag) \
     657    do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag)); } while (0)
    695658
    696659/** @def VMCPU_FF_CLEAR
     
    700663 * @param   fFlag   The flag to clear.
    701664 */
    702 #if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
    703 # define VMCPU_FF_CLEAR(pVCpu, fFlag)       ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag))
    704 #else
    705 # define VMCPU_FF_CLEAR(pVCpu, fFlag) \
    706     ([](PVMCPU a_pVCpu) -> void \
    707     { \
    708         AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
    709         ASMAtomicAndU32(&a_pVCpu->fLocalForcedActions, ~(fFlag)); \
    710     }(pVCpu))
    711 #endif
     665#define VMCPU_FF_CLEAR(pVCpu, fFlag) \
     666    do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag)); } while (0)
    712667
    713668/** @def VMCPU_FF_CLEAR_MASK
     
    717672 * @param   fFlags  The flags to clear.
    718673 */
    719 #define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags)  ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlags))
     674#define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) \
     675    do { ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlags)); } while (0)
    720676
    721677/** @def VM_FF_IS_SET
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