c++ - limits.h 中的条件编译语句

标签 c++ c gcc compiler-construction conditional-compilation

我无法理解文件 limits.h 中的以下语句。这个语句有什么用,它有什么作用?

/* 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

最佳答案

它会检查您的程序是否由 GCC 以外的其他编译器编译,或者是某个非常旧的 GCC 版本。

关于c++ - limits.h 中的条件编译语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2355300/

相关文章:

c++ - CGAL::Surface_mesh 当顶点和面的数量已知时创建表面网格

c++ - 可执行文件中定义的函数名称(使用 dladdr)

C : Valgrind telling "Invalid write of size 4" but can't locate the problem

c - 使用 openGL ES 1.1 渲染 .h Blender 导出到 iPhone

c++ - 使用位置无关代码按值和指针传递

c - 如何在特定范围内创建新的随机整数

C++ 继承 - 不明确的函数

c# - 从 C++ native 插件更新 Vector3 数组

c - 将程序分成多个文件 - 出现错误 "redefinition; different basic types"

c++ - 私有(private)静态成员可以用作其类的成员函数的默认参数吗?