如何使用ifdef检测英特尔的编译器(ICC)? [英] How to detect Intel's compiler (ICC) with ifdef?

查看:70
本文介绍了如何使用ifdef检测英特尔的编译器(ICC)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Linux上使用Intel当前的编译器.我有一个应该用于检测编译器的内联宏.

I want to use Intel's current compiler on Linux. I have an inline macro which is supposed to detect the compiler.

它曾经与GCC和ICC的以前的版本一起使用.但是现在我有了ICC的 extern inline .ICC现在是否定义 __ GNUC __ ?您将如何检测ICC或英特尔C ++编译器ICPC?

It used to work with past versions of GCC and ICC. But now I get extern inline with ICC. Does ICC now define __GNUC__? How would you detect ICC or Intel's C++ compiler, ICPC?

#ifndef INLINE
# if defined(__GNUC__) || defined(__GNUG__)
#  define INLINE extern inline
# else
#  define INLINE inline
# endif
#endif

您正在寻找

推荐答案

__ INTEL_COMPILER .(来源: ICC手册页)

这篇关于如何使用ifdef检测英特尔的编译器(ICC)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆