best-practice on C header files with #ifndef #define #endif

后端 未结 5 2171
误落风尘
误落风尘 2020-12-09 18:25

what is concerned best practice regarding the following \"pattern\"?

#ifndef BLAFOO_H
#define BLAFOO_H
/* ...
 * ...
 */
#endif /* BLAFOO_H */
5条回答
  •  温柔的废话
    2020-12-09 19:11

    I use an UUID that is my guarantee that #define not clashed with others. I've seen it somewhere and decided to use it as well.

    My pattern is like this: ___H___,

    eg. #define __TYPES_H_79057761_16D6_478A_BFBC_BBF17BD3E9B9__ for a file named types.h

提交回复
热议问题