zoukankan      html  css  js  c++  java
  • Linux中常使用的宏判断的几个例子

    示例一

    #ifdef CONFIG_XX1
    ......
    #endif

     

    示例二

    #ifdef CONFIG_XX1
    ......
    #else
    ......
    #endif

     

    示例三

    #if defined(CONFIG_MEDIA_CONTROLLER)
    ......
    #endif
    
    或者
    
    #if defined CONFIG_MEDIA_CONTROLLER
    ......
    #endif

     

    示例四

    #if defined HCF_CFG_HSI_3_TOP || defined HCF_CFG_HSI_3_BOTTOM
    ......
    #endif
    
    或者
    
    #if defined(HCF_CFG_HSI_3_TOP) || defined(HCF_CFG_HSI_3_BOTTOM)
    ......
    #endif

     

    示例五

    #if !defined(SBE_ISR_TASKLET) && !defined(SBE_ISR_IMMEDIATE) && !defined(SBE_ISR_INLINE)
    ......
    #endif

     

    示例六

    #if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE
    ...... #endif

     

    示例七

    #if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
    ......
    #endif

     

    示例八

    #ifdef    CONFIG_USB_OTG
    ......
    #elif    !defined(CONFIG_USB_OHCI_HCD) && !defined(CONFIG_USB_OHCI_HCD_MODULE)
    ......
    #else
    ......
    #endif

     

    示例九

    #if PLATFORM == INTEL
    #define ACON1_BASE        (WS_MODES | A1_RUN)
    #elif PLATFORM == MOTOROLA
    #define ACON1_BASE        (WS_MODES | A1_RUN | A1_SWAP | A2_SWAP)
    #endif

     

    示例十

    #if defined _RTL871X_XMIT_C_
    ......
    #elif defined _XMIT_OSDEP_C_
    ......
    #elif defined _RTL871X_RECV_C_
    ......
    #endif

     

    示例十一

    #if defined(CONFIG_1) || (defined(CONFIG_2) && !defined(CONFIG_3))
    ......
    #endif

    示例十二

    #if defined(CONFIG_MTRR) && 0
    ......
    #endif

     

  • 相关阅读:
    【leetcode】1103. Distribute Candies to People
    【leetcode】1074. Number of Submatrices That Sum to Target
    【leetcode】1095. Find in Mountain Array
    【leetcode】1094. Car Pooling
    2018.9.27 长难句1
    L142
    L141
    L140
    Agilent RF fundamentals (11)-Vector modulator
    Agilent RF fundamentals (10) Mixer ,Phase domain and modulator
  • 原文地址:https://www.cnblogs.com/pengdonglin137/p/4238128.html
Copyright © 2011-2022 走看看