1在SWTYPE.h定义
#include<memory.h>
#include<pthread.h>//注意pthread.h是外部库,要能正确编译请参考:http://blog.csdn.net/zhangyulin54321/article/details/8166299
#define sw_mem_set(buf,value,size) memset((buf),(value),(size))
#ifdef SW4_UNIX
#define sw_strtok(s1,s2,s3) )strtok_r((char *)(s1),(char *)(s2),(char **)(s3))
#else
#define sw_strtok(s1,s2) strtok((char*)(s1),(char*)(s2))
#define swthread_key_create pthread_key_create
#endif
2测试:
test.cpp