Tag: coop

隐藏C结构定义

这是我的设置: 在public.h: #ifndef PUBLIC_H_ #define PUBLIC_H_ #include “func.h” /*extern typedef struct _my_private_struct PRIVATE_;*/ typedef struct _my_private_struct PRIVATE_; /* Thanks to larsmans and Simon Richter */ #endif 在struct.h中 #ifndef STRUCT_H_ #define STRUCT_H_ struct _my_private_struct { int i; }; #endif 在func.h中: #ifndef FUNC_H_ #define FUNC_H_ #include “struct.h” /* typedef struct _my_private_struct PRIVATE_; */ extern PRIVATE_ * get_new(int); […]