#define __STDC_CONSTANT_MACROS的作用

最近在学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.

原文连接

你可能感兴趣的:(Ffmpeg)