diff --git a/trunk/configure b/trunk/configure index b1313d8c0..ec7220d6b 100755 --- a/trunk/configure +++ b/trunk/configure @@ -200,7 +200,7 @@ MODULE_ID="CORE" MODULE_DEPENDS=() ModuleLibIncs=(${SRS_OBJS_DIR}) MODULE_FILES=("srs_core" "srs_core_version5" "srs_core_autofree" "srs_core_performance" - "srs_core_time") + "srs_core_time" "srs_core_platform") CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh CORE_OBJS="${MODULE_OBJS[@]}" # diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index e40b9c098..d8c1aeeb1 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -32,34 +32,8 @@ #define VERSION_STABLE 4 #define VERSION_STABLE_BRANCH SRS_XSTR(VERSION_STABLE) ".0release" -// For 32bit os, 2G big file limit for unistd io, -// ie. read/write/lseek to use 64bits size for huge file. -#ifndef _FILE_OFFSET_BITS - #define _FILE_OFFSET_BITS 64 -#endif - -// For int64_t print using PRId64 format. -#ifndef __STDC_FORMAT_MACROS - #define __STDC_FORMAT_MACROS -#endif - -// For RTC/FFMPEG build. -#if defined(SRS_RTC) && !defined(__STDC_CONSTANT_MACROS) - #define __STDC_CONSTANT_MACROS -#endif - -// For srs-librtmp, @see https://github.com/ossrs/srs/issues/213 -#ifndef _WIN32 -#include -#endif - -#include -#ifndef srs_assert -#define srs_assert(expression) assert(expression) -#endif - -#include -#include +// For platform specified headers and defines. +#include // The time unit for timeout, interval or duration. #include diff --git a/trunk/src/core/srs_core_platform.cpp b/trunk/src/core/srs_core_platform.cpp new file mode 100644 index 000000000..1da0af075 --- /dev/null +++ b/trunk/src/core/srs_core_platform.cpp @@ -0,0 +1,8 @@ +// +// Copyright (c) 2013-2021 The SRS Authors +// +// SPDX-License-Identifier: MIT +// + +#include + diff --git a/trunk/src/core/srs_core_platform.hpp b/trunk/src/core/srs_core_platform.hpp new file mode 100644 index 000000000..c55f8e452 --- /dev/null +++ b/trunk/src/core/srs_core_platform.hpp @@ -0,0 +1,45 @@ +// +// Copyright (c) 2013-2021 The SRS Authors +// +// SPDX-License-Identifier: MIT +// + +#ifndef SRS_CORE_PLATFORM_HPP +#define SRS_CORE_PLATFORM_HPP + +// For 32bit os, 2G big file limit for unistd io, +// ie. read/write/lseek to use 64bits size for huge file. +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif + +// For int64_t print using PRId64 format. +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif + +// For RTC/FFMPEG build. +#if defined(SRS_RTC) && !defined(__STDC_CONSTANT_MACROS) +#define __STDC_CONSTANT_MACROS +#endif + +// For srs-librtmp, @see https://github.com/ossrs/srs/issues/213 +#ifndef _WIN32 +#include +#endif + +#include +#ifndef srs_assert +#define srs_assert(expression) assert(expression) +#endif + +#include +#include + +// For CentOS 6 or C++98, @see https://github.com/ossrs/srs/issues/2815 +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif + diff --git a/trunk/src/kernel/srs_kernel_mp4.cpp b/trunk/src/kernel/srs_kernel_mp4.cpp index b9c35f441..14db2c730 100644 --- a/trunk/src/kernel/srs_kernel_mp4.cpp +++ b/trunk/src/kernel/srs_kernel_mp4.cpp @@ -19,11 +19,6 @@ #include using namespace std; -// For CentOS 6 or C++98, @see https://github.com/ossrs/srs/issues/2815 -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - #define SRS_MP4_EOF_SIZE 0 #define SRS_MP4_USE_LARGE_SIZE 1