#define __STDC_CONSTANT_MACROS的作用

来源:互联网 发布:淘宝钻石展位和直通车 编辑:程序博客网 时间:2024/05/10 04:21
最近在学FFmpeg,看到demo开头有这么一行#define __STDC_CONSTANT_MACROS 瞬间就懵了(好吧,我是搞java的)经过一番搜索后,其作用为:
__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.This isn't part of the C++ standard, but it has been adopted by more than one implementation.

原文连接

1 0