mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
SRT: Build SRT from source by SRS. 4.0.115
This commit is contained in:
parent
262f0fc8c8
commit
90f1b482ab
115 changed files with 44513 additions and 19 deletions
63
trunk/3rdparty/srt-1-fit/common/win/ATTIC/winporting.h
vendored
Normal file
63
trunk/3rdparty/srt-1-fit/common/win/ATTIC/winporting.h
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
#ifndef _WINPORTING_H_
|
||||
#define _WINPORTING_H_
|
||||
|
||||
// NOTE: This file has been borrowed from LCM project
|
||||
// http://lcm-proj.github.io/
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#define strtoll _strtoi64
|
||||
#define strdup _strdup
|
||||
#define mode_t int
|
||||
#define snprintf _snprintf
|
||||
//#define PATH_MAX MAX_PATH
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
//#define socklen_t int
|
||||
#define in_addr_t in_addr
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#define HUGE HUGE_VAL
|
||||
#define O_NONBLOCK 0x4000
|
||||
#define F_GETFL 3
|
||||
#define F_SETFL 4
|
||||
#endif
|
||||
|
||||
#include <direct.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Microsoft implementation of these structures has the
|
||||
// pointer and length in reversed positions.
|
||||
typedef struct iovec
|
||||
{
|
||||
ULONG iov_len;
|
||||
char *iov_base;
|
||||
} iovec;
|
||||
|
||||
typedef struct msghdr
|
||||
{
|
||||
struct sockaddr *msg_name;
|
||||
int msg_namelen;
|
||||
struct iovec *msg_iov;
|
||||
ULONG msg_iovlen;
|
||||
int msg_controllen;
|
||||
char *msg_control;
|
||||
ULONG msg_flags;
|
||||
} msghdr;
|
||||
|
||||
//typedef long int ssize_t;
|
||||
|
||||
//int inet_aton(const char *cp, struct in_addr *inp);
|
||||
|
||||
int fcntl (int fd, int flag1, ...);
|
||||
|
||||
size_t recvmsg ( SOCKET s, struct msghdr *msg, int flags );
|
||||
size_t sendmsg ( SOCKET s, const struct msghdr *msg, int flags );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _WINPORTING_H_
|
45
trunk/3rdparty/srt-1-fit/common/win/syslog_defs.h
vendored
Normal file
45
trunk/3rdparty/srt-1-fit/common/win/syslog_defs.h
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
#ifndef INC__WINDOWS_SYSLOG_DEFS_H
|
||||
#define INC__WINDOWS_SYSLOG_DEFS_H
|
||||
|
||||
#define LOG_EMERG 0
|
||||
#define LOG_ALERT 1
|
||||
#define LOG_CRIT 2
|
||||
#define LOG_ERR 3
|
||||
#define LOG_WARNING 4
|
||||
#define LOG_NOTICE 5
|
||||
#define LOG_INFO 6
|
||||
#define LOG_DEBUG 7
|
||||
|
||||
#define LOG_PRIMASK 0x07
|
||||
|
||||
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
|
||||
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
|
||||
|
||||
#define LOG_KERN (0<<3)
|
||||
#define LOG_USER (1<<3)
|
||||
#define LOG_MAIL (2<<3)
|
||||
#define LOG_DAEMON (3<<3)
|
||||
#define LOG_AUTH (4<<3)
|
||||
#define LOG_SYSLOG (5<<3)
|
||||
#define LOG_LPR (6<<3)
|
||||
#define LOG_NEWS (7<<3)
|
||||
#define LOG_UUCP (8<<3)
|
||||
#define LOG_CRON (9<<3)
|
||||
#define LOG_AUTHPRIV (10<<3)
|
||||
#define LOG_FTP (11<<3)
|
||||
|
||||
/* Codes through 15 are reserved for system use */
|
||||
#define LOG_LOCAL0 (16<<3)
|
||||
#define LOG_LOCAL1 (17<<3)
|
||||
#define LOG_LOCAL2 (18<<3)
|
||||
#define LOG_LOCAL3 (19<<3)
|
||||
#define LOG_LOCAL4 (20<<3)
|
||||
#define LOG_LOCAL5 (21<<3)
|
||||
#define LOG_LOCAL6 (22<<3)
|
||||
#define LOG_LOCAL7 (23<<3)
|
||||
|
||||
#define LOG_NFACILITIES 24
|
||||
#define LOG_FACMASK 0x03f8
|
||||
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
|
||||
|
||||
#endif
|
52
trunk/3rdparty/srt-1-fit/common/win/unistd.h
vendored
Normal file
52
trunk/3rdparty/srt-1-fit/common/win/unistd.h
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
#ifndef _UNISTD_H
|
||||
#define _UNISTD_H 1
|
||||
|
||||
/* This file intended to serve as a drop-in replacement for
|
||||
* unistd.h on Windows
|
||||
* Please add functionality as neeeded
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <io.h>
|
||||
//#include <getopt.h> /* getopt at: https://gist.github.com/ashelly/7776712*/
|
||||
#include <process.h> /* for getpid() and the exec..() family */
|
||||
#include <direct.h> /* for _getcwd() and _chdir() */
|
||||
|
||||
#define srandom srand
|
||||
#define random rand
|
||||
|
||||
/* Values for the second argument to access.
|
||||
These may be OR'd together. */
|
||||
#define R_OK 4 /* Test for read permission. */
|
||||
#define W_OK 2 /* Test for write permission. */
|
||||
//#define X_OK 1 /* execute permission - unsupported in windows*/
|
||||
#define F_OK 0 /* Test for existence. */
|
||||
|
||||
#define access _access
|
||||
#define dup2 _dup2
|
||||
#define execve _execve
|
||||
#define ftruncate _chsize
|
||||
#define unlink _unlink
|
||||
#define fileno _fileno
|
||||
#define getcwd _getcwd
|
||||
#define chdir _chdir
|
||||
#define isatty _isatty
|
||||
#define lseek _lseek
|
||||
/* read, write, and close are NOT being #defined here, because while there are file handle specific versions for Windows, they probably don't work for sockets. You need to look at your app and consider whether to call e.g. closesocket(). */
|
||||
|
||||
#define ssize_t int
|
||||
|
||||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
/* should be in some equivalent to <sys/types.h> */
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
#endif /* unistd.h */
|
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