conditional compilation statement in limits.h
-
23-09-2019 - |
Question
I am not able to understand the following statement from the file limits.h. What is the use of this statement and what does it accomplishes?
/* If we are not using GNU CC we have to define all the symbols ourself.
Otherwise use gcc's definitions (see below). */
#if !defined __GNUC__ || __GNUC__ < 2
Solution
It checks if your program is compiled by some other compiler than GCC, or some very old GCC version.
OTHER TIPS
It checks whether you are not using a Gcc compiler Version 2 or Gcc some other versions. using this pre-processor macro we can some portable codes.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow