mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #2815: Extract macros and headers for platform.
This commit is contained in:
parent
716e578a19
commit
13103ec7d5
5 changed files with 56 additions and 34 deletions
2
trunk/configure
vendored
2
trunk/configure
vendored
|
@ -200,7 +200,7 @@ MODULE_ID="CORE"
|
||||||
MODULE_DEPENDS=()
|
MODULE_DEPENDS=()
|
||||||
ModuleLibIncs=(${SRS_OBJS_DIR})
|
ModuleLibIncs=(${SRS_OBJS_DIR})
|
||||||
MODULE_FILES=("srs_core" "srs_core_version5" "srs_core_autofree" "srs_core_performance"
|
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_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh
|
||||||
CORE_OBJS="${MODULE_OBJS[@]}"
|
CORE_OBJS="${MODULE_OBJS[@]}"
|
||||||
#
|
#
|
||||||
|
|
|
@ -32,34 +32,8 @@
|
||||||
#define VERSION_STABLE 4
|
#define VERSION_STABLE 4
|
||||||
#define VERSION_STABLE_BRANCH SRS_XSTR(VERSION_STABLE) ".0release"
|
#define VERSION_STABLE_BRANCH SRS_XSTR(VERSION_STABLE) ".0release"
|
||||||
|
|
||||||
// For 32bit os, 2G big file limit for unistd io,
|
// For platform specified headers and defines.
|
||||||
// ie. read/write/lseek to use 64bits size for huge file.
|
#include <srs_core_platform.hpp>
|
||||||
#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 <inttypes.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#ifndef srs_assert
|
|
||||||
#define srs_assert(expression) assert(expression)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
// The time unit for timeout, interval or duration.
|
// The time unit for timeout, interval or duration.
|
||||||
#include <srs_core_time.hpp>
|
#include <srs_core_time.hpp>
|
||||||
|
|
8
trunk/src/core/srs_core_platform.cpp
Normal file
8
trunk/src/core/srs_core_platform.cpp
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013-2021 The SRS Authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <srs_core_platform.hpp>
|
||||||
|
|
45
trunk/src/core/srs_core_platform.hpp
Normal file
45
trunk/src/core/srs_core_platform.hpp
Normal file
|
@ -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 <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#ifndef srs_assert
|
||||||
|
#define srs_assert(expression) assert(expression)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
// For CentOS 6 or C++98, @see https://github.com/ossrs/srs/issues/2815
|
||||||
|
#ifndef UINT32_MAX
|
||||||
|
#define UINT32_MAX (4294967295U)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -19,11 +19,6 @@
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
using namespace std;
|
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_EOF_SIZE 0
|
||||||
#define SRS_MP4_USE_LARGE_SIZE 1
|
#define SRS_MP4_USE_LARGE_SIZE 1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue