求解extern "C"
本帖最后由 zyouhua83 于 2012-12-10 14:25:53 编辑
#ifndef MyTest__h__
#define MyTest__h__
#ifdef __cplusplus
extern "C" { //...........1处是否有意义
#endif
typedef struct IMyTest IMyTest;
typedef void (*_setMyTest_t)(IMyTest * nMyTest);
#ifdef __cplusplus
}
#endif
#endif // MyTest-_h__
#ifndef MyTest_h__
#define MyTest_h__
#ifdef _MSC_VER
#pragma pack(push,1)
#endif
#ifdef __cplusplus
extern "C" { //..........2处是否有意义
#endif
struct IMyTest
{
_setMyTest_t mSetMyTest;
void * mMyTest;
}__pack;
#ifdef __cplusplus
}
#endif
#ifdef _MSC_VER
#pragma pack(pop)
#endif
#endif // MyTest_h__