问题描述
我在我的系统的标准C ++库以及我使用的库中的一些标头上看到了这一点。
I see this in the standard C++ libraries for my system, as well as some of the headers in a library I'm using.
什么是语义这两个定义?
What are the semantics of these two definitions? Is there a good reference for #defines like this other than the source itself?
推荐答案
__ STDC_LIMIT_MACROS
__STDC_LIMIT_MACROS
and __STDC_CONSTANT_MACROS
are a workaround to allow C++ programs to use stdint.h
macros specified in the C99 standard that aren't in the C++ standard. The macros, such as UINT8_MAX
, INT64_MIN
, and INT32_C()
may be defined already in C++ applications in other ways. To allow the user to decide if they want the macros defined as C99 does, many implementations require that __STDC_LIMIT_MACROS
and __STDC_CONSTANT_MACROS
be defined before stdint.h
is included.
这不是C ++标准的一部分,通过多个实现。
This isn't part of the C++ standard, but it has been adopted by more than one implementation.
这篇关于__STDC_LIMIT_MACROS和__STDC_CONSTANT_MACROS是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!