zoukankan      html  css  js  c++  java
  • 有用的宏

    // Calculate the byte offset of a field in a structure of type type.
    //
    
    #define FIELD_OFFSET(type, field)    ((LONG)(INT_PTR)&(((type *)0)->field))
    
    #define ANSI_NULL ((CHAR)0)     
    #define UNICODE_NULL ((WCHAR)0) 
    
    #define MAKELANGID(p, s)       ((((WORD  )(s)) << 10) | (WORD  )(p))
    #define PRIMARYLANGID(lgid)    ((WORD  )(lgid) & 0x3ff)
    #define SUBLANGID(lgid)        ((WORD  )(lgid) >> 10)
    
    
    #define LANG_CHINESE                     0x04
    #define SUBLANG_CHINESE_SIMPLIFIED       0x02    // Chinese (PR China)
    Use locale names instead of LCIDs
    
    LCIDs (locale identifiers) don't support custom locales and have some inconsistencies. 
    Its better to use locale names (ie: en-US) when possible
    This doesn't work for custom locales
    Custom locales all have the same langid, sublangid, etc. so LCIDs and their derived parts are pretty useless for describing locales accurately. 
    en-FJ, fj-FJ and klingon would all have the same LCID/langid/sublangid.
    Use locale names (en-US, etc) insteadl.
    
    
    // 微软也用pc-lint的代码,而且开作弊
    #define UNREFERENCED_PARAMETER(P) \
    /*lint -e527 -e530 */ \
    { \
        (P) = (P); \
    } \
    /*lint +e527 +e530 */
    
    #define STATUS_WAIT_0                    ((DWORD   )0x00000000L)
    
    
    
  • 相关阅读:
    kuangbin_ShortPath K (POJ 3159)
    kuangbin_ShortPath I (POJ 2240)
    kuangbin_ShortPath H (POJ 3660)
    kuangbin_ShortPath G (POJ 1502)
    kuangbin_ShortPath J (POJ 1511)
    kuangbin_ShortPath F (POJ 3259)
    kuangbin_ShortPath E (POJ 1860)
    StoryBoard中使用xib
    iOS APP 架构漫谈[转]
    Mac 快速修改 hosts 文件
  • 原文地址:https://www.cnblogs.com/csuchao/p/2073904.html
Copyright © 2011-2022 走看看