如何聲明宏定義的函數:
請看下面:
#include <stdio.h>
#define CTOR(type) \
void type##Setting() \
{ \
printf("%s\n","sss"); \
}
CTOR(type);
dd.h 中
#define CTOR(type) \
void type##Setting();
然後主函數 demo.c中
#include "dd.h"
extern CTOR(type)
int main()
{
typeSetting();
return(0);
}
http://bbs.bccn.net/thread-285907-1-1.html