From 62ab1a1c695c933b938042135baa391bb34162df Mon Sep 17 00:00:00 2001 From: mingo-wu <57790355+mingo-wu1@users.noreply.github.com> Date: Mon, 21 Nov 2022 20:31:00 +0800 Subject: [PATCH] Fix the recursively included issue for srs_core_time.hpp (#3159) * Update srs_core_time.hpp In included file: main file cannot be included recursively when building a preambleclang(pp_including_mainfile_in_preamble) srs_core.hpp(43, 10): Error occurred here * Update srs_core_time.hpp Reference to trunk/src/protocol/srs_protocol_http_stack.hpp (!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__) typedef __int8 int8_t; typedef unsigned __int8 uint8_t; typedef __int16 int16_t; typedef unsigned __int16 uint16_t; typedef __int32 int32_t; typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; --- trunk/src/core/srs_core_time.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trunk/src/core/srs_core_time.hpp b/trunk/src/core/srs_core_time.hpp index bfcbbf1a7..01d1939dc 100644 --- a/trunk/src/core/srs_core_time.hpp +++ b/trunk/src/core/srs_core_time.hpp @@ -7,10 +7,14 @@ #ifndef SRS_CORE_TIME_HPP #define SRS_CORE_TIME_HPP -#include - // Time and duration unit, in us. +#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__) +#include +typedef __int64 srs_utime_t; +#else +#include typedef int64_t srs_utime_t; +#endif // The time unit in ms, for example 100 * SRS_UTIME_MILLISECONDS means 100ms. #define SRS_UTIME_MILLISECONDS 1000