在visual studio中,使用extern "C"语句会导致后面的整个代码块都被缩进:

对强迫症患者来说这里看起来很不舒服,而且使用这个语句也只是为了使C兼容CPP,本身写的就是C而已,并不希望这里有缩进。

解决方案:

#ifndef __BST_TREE_H__
#define __BST_TREE_H__

#ifdef __cplusplus
extern "C" {
#endif
// 添加下面三行
#if 0
}
#endif

struct bst_tree_node_st {
};

#if 0
{
#endif
#ifdef __cplusplus
}
#endif

#endi
最后修改:2019 年 04 月 24 日
如果觉得我的文章对你有用,请随意赞赏