C++等效于C99外部直列__Attribute __(((ewnissy_ewanse_inline)))
嗨,
我阅读 wiki 然后我意识到“ extern inline”在C99和C99和C99和C99和C ++。
例如:
foo.cpp
#include <stdio.h>
extern inline __attribute__((always_inline))
void test1(int b) {
if (b) {
printf("foo");
}
}
void test2() {
test1(0);
}
main.cpp
void test1(int);
void test2();
int main() {
test1(0);
test2();
}
i可以通过使用'-xc -std = c99'对G ++和Clang ++进行编译和链接。
但是,我确实需要一个C ++等同于此,有什么想法吗?
非常感谢。
PS当前的解决方法正在使用包装器功能,这不是优雅的。
Hi,
I read the wiki then I realized "extern inline" is different between C99 and C++.
For example:
foo.cpp
#include <stdio.h>
extern inline __attribute__((always_inline))
void test1(int b) {
if (b) {
printf("foo");
}
}
void test2() {
test1(0);
}
main.cpp
void test1(int);
void test2();
int main() {
test1(0);
test2();
}
I can compile and link them by using '-xc -std=c99' for g++ and clang++.
However, I do need a C++ equivalent of this, any idea?
Thank you very much.
P.S. The current workaround is using a wrapper function, which is not elegant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论