mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
SuqashSRS4: Build SRT native
This commit is contained in:
parent
a1d7fe46c1
commit
e3bca883e1
150 changed files with 45007 additions and 398 deletions
56
trunk/3rdparty/srt-1-fit/common/win/wintime.h
vendored
Normal file
56
trunk/3rdparty/srt-1-fit/common/win/wintime.h
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
#ifndef INC__WIN_WINTIME
|
||||
#define INC__WIN_WINTIME
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
// HACK: This include is a workaround for a bug in the MinGW headers
|
||||
// where pthread.h, which defines _POSIX_THREAD_SAFE_FUNCTIONS,
|
||||
// has to be included before time.h so that time.h defines
|
||||
// localtime_r correctly
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
#define SRTCOMPAT_WINTIME_STATIC_INLINE_DECL static inline
|
||||
#else
|
||||
// NOTE: MVC Does not like static inline for C functions in some versions.
|
||||
// so just use static for MVC.
|
||||
#define SRTCOMPAT_WINTIME_STATIC_INLINE_DECL static
|
||||
#endif
|
||||
|
||||
#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
|
||||
#define _TIMEZONE_DEFINED
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest; /* minutes W of Greenwich */
|
||||
int tz_dsttime; /* type of dst correction */
|
||||
};
|
||||
#endif
|
||||
|
||||
void SRTCompat_timeradd(
|
||||
struct timeval *a, struct timeval *b, struct timeval *result);
|
||||
SRTCOMPAT_WINTIME_STATIC_INLINE_DECL void timeradd(
|
||||
struct timeval *a, struct timeval *b, struct timeval *result)
|
||||
{
|
||||
SRTCompat_timeradd(a, b, result);
|
||||
}
|
||||
|
||||
int SRTCompat_gettimeofday(
|
||||
struct timeval* tp, struct timezone* tz);
|
||||
SRTCOMPAT_WINTIME_STATIC_INLINE_DECL int gettimeofday(
|
||||
struct timeval* tp, struct timezone* tz)
|
||||
{
|
||||
return SRTCompat_gettimeofday(tp, tz);
|
||||
}
|
||||
|
||||
#undef SRTCOMPAT_WINTIME_STATIC_INLINE_DECL
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // INC__WIN_WINTIME
|
Loading…
Add table
Add a link
Reference in a new issue