Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect ICC vs GCC at compile time

How to detect at compile time if I'm using gcc or icc?

(I was quite puzzled to find out that icc defines __GNUC__ -- and even __GNUC_MINOR__ and __GNUC_PATCHLEVEL__ ! why?)

like image 524
Znorg Avatar asked Apr 20 '11 21:04

Znorg


1 Answers

We use

#ifdef __INTEL_COMPILER

to split icc off, assuming gcc as a default.

like image 167
Dirk Eddelbuettel Avatar answered Sep 21 '22 08:09

Dirk Eddelbuettel