From a486687e16a88cd615aae4a1ef3315c0f08c9e2c Mon Sep 17 00:00:00 2001 From: hyc Date: Thu, 17 Dec 2009 01:10:04 +0000 Subject: [PATCH] MinGW portability fixes git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@79 400ebc74-4327-4243-bc38-086b20814532 --- rtmp.c | 9 ++++----- rtmpdump.c | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/rtmp.c b/rtmp.c index 2630b31..6332576 100644 --- a/rtmp.c +++ b/rtmp.c @@ -25,17 +25,16 @@ #include #include #include - -#include -#include -#include - #include #ifdef WIN32 #include #define close(x) closesocket(x) +#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e) #else +#include +#include +#include #include #endif diff --git a/rtmpdump.c b/rtmpdump.c index 0e6e8fb..f35fc22 100644 --- a/rtmpdump.c +++ b/rtmpdump.c @@ -97,11 +97,13 @@ sigIntHandler(int sig) bCtrlC = true; LogPrintf("Caught signal: %d, cleaning up, just a second...\n", sig); // ignore all these signals now and let the connection close - signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); - signal(SIGPIPE, SIG_IGN); signal(SIGTERM, SIG_IGN); +#ifndef WIN32 + signal(SIGHUP, SIG_IGN); + signal(SIGPIPE, SIG_IGN); signal(SIGQUIT, SIG_IGN); +#endif } int @@ -1100,13 +1102,22 @@ main(int argc, char **argv) char *flvFile = 0; - char DEFAULT_FLASH_VER[] = "LNX 10,0,22,87"; +#undef OSS +#ifdef WIN32 +#define OSS "WIN" +#else +#define OSS "LNX" +#endif + + char DEFAULT_FLASH_VER[] = OSS " 10,0,22,87"; - signal(SIGHUP, sigIntHandler); signal(SIGINT, sigIntHandler); - signal(SIGPIPE, sigIntHandler); signal(SIGTERM, sigIntHandler); +#ifndef WIN32 + signal(SIGHUP, sigIntHandler); + signal(SIGPIPE, sigIntHandler); signal(SIGQUIT, sigIntHandler); +#endif /* sleep(30); */ -- 2.40.0