关于define语句的一个问题

chenxue1111 2013-05-04 02:13:35
#define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL

这句话咋理解?
...全文
147 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hugett 2013-05-05
  • 打赏
  • 举报
回复
引用 6 楼 chenxue1111 的回复:
[quote=引用 4 楼 hugett 的回复:] 将
CVAPI(rettype)
替换为
CV_EXTERN_C CV_EXPORTS rettype CV_CDECL
像你上边的例子,就会展开为

CV_EXTERN_C CV_EXPORTS void CV_CDECL cvCircle( CvArr* img, CvPoint center, int radius, CvScalar color, int thickness CV_DEFAULT(1), int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
有点懂了,rettype是不是就是函数类型?[/quote] 是什么都可以。。只是直接的文本替换。。
chenxue1111 2013-05-05
  • 打赏
  • 举报
回复
引用 4 楼 hugett 的回复:
CVAPI(rettype)
替换为
CV_EXTERN_C CV_EXPORTS rettype CV_CDECL
像你上边的例子,就会展开为

CV_EXTERN_C CV_EXPORTS void CV_CDECL cvCircle( CvArr* img, CvPoint center, int radius, CvScalar color, int thickness CV_DEFAULT(1), int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
有点懂了,rettype是不是就是函数类型?
derekrose 2013-05-05
  • 打赏
  • 举报
回复
就是简单的替换而已,应该就是对函数声明进行约束吧
hugett 2013-05-05
  • 打赏
  • 举报
回复
CVAPI(rettype)
替换为
CV_EXTERN_C CV_EXPORTS rettype CV_CDECL
像你上边的例子,就会展开为

CV_EXTERN_C CV_EXPORTS void CV_CDECL cvCircle( CvArr* img, CvPoint center, int radius, CvScalar color, int thickness CV_DEFAULT(1), int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
chenxue1111 2013-05-04
  • 打赏
  • 举报
回复
引用 1 楼 combobox2013 的回复:
extern"C" dllexport 返回值类型 _cdecl 函数名(参数)
没大明白你的意思
chenxue1111 2013-05-04
  • 打赏
  • 举报
回复
CVAPI(void)  cvCircle( CvArr* img, CvPoint center, int radius,
                       CvScalar color, int thickness CV_DEFAULT(1),
                       int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
它是用在这里的
combobox2013 2013-05-04
  • 打赏
  • 举报
回复
extern"C" dllexport 返回值类型 _cdecl 函数名(参数)

33,311

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧