Browse Source

contrib: live555: Don't reimplement gettimeofday when using mingw.

It already has its implementation.
pull/43/head
Hugo Beauzée-Luyssen 10 years ago
parent
commit
4a8c90274d
  1. 54
      contrib/src/live555/no-gettimeofday.patch
  2. 1
      contrib/src/live555/rules.mak

54
contrib/src/live555/no-gettimeofday.patch

@ -0,0 +1,54 @@
--- live555/groupsock/GroupsockHelper.cpp.orig 2016-03-30 21:07:02.538195751 +0200
+++ live555/groupsock/GroupsockHelper.cpp 2016-03-30 21:07:23.286235570 +0200
@@ -755,7 +755,7 @@
return (char const*)&timeString;
}
-#if defined(__WIN32__) || defined(_WIN32)
+#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
// For Windoze, we need to implement our own gettimeofday()
// used to make sure that static variables in gettimeofday() aren't initialized simultaneously by multiple threads
--- live555/groupsock/include/GroupsockHelper.hh.orig 2016-03-31 10:11:32.734142022 +0200
+++ live555/groupsock/include/GroupsockHelper.hh 2016-03-31 10:11:51.614092708 +0200
@@ -130,7 +130,7 @@
void reclaimGroupsockPriv(UsageEnvironment& env);
-#if defined(__WIN32__) || defined(_WIN32)
+#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
// For Windoze, we need to implement our own gettimeofday()
extern int gettimeofday(struct timeval*, int*);
#endif
--- live555/groupsock/GroupsockHelper.cpp.orig 2016-03-31 10:16:23.765299784 +0200
+++ live555/groupsock/GroupsockHelper.cpp 2016-03-31 10:17:00.701127166 +0200
@@ -20,7 +20,7 @@
#include "GroupsockHelper.hh"
-#if defined(__WIN32__) || defined(_WIN32)
+#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
#include <time.h>
extern "C" int initializeWinsockIfNecessary();
#else
--- live555/groupsock/GroupsockHelper.cpp.orig 2016-03-31 10:17:46.284928287 +0200
+++ live555/groupsock/GroupsockHelper.cpp 2016-03-31 10:20:20.428341877 +0200
@@ -27,6 +27,7 @@
#include <stdarg.h>
#include <time.h>
#include <fcntl.h>
+#include <sys/time.h>
#define initializeWinsockIfNecessary() 1
#endif
#if defined(__WIN32__) || defined(_WIN32) || defined(_QNX4)
--- live555/groupsock/include/GroupsockHelper.hh.orig 2016-03-31 10:22:56.667834195 +0200
+++ live555/groupsock/include/GroupsockHelper.hh 2016-03-31 10:23:37.411710728 +0200
@@ -133,6 +133,8 @@
#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
// For Windoze, we need to implement our own gettimeofday()
extern int gettimeofday(struct timeval*, int*);
+#else
+#include <sys/time.h>
#endif
// The following are implemented in inet.c:

1
contrib/src/live555/rules.mak

@ -54,6 +54,7 @@ ifdef HAVE_ANDROID
cd live && sed -e 's%-DPIC%-DPIC -DNO_SSTREAM=1 -DLOCALE_NOT_USED -I$(ANDROID_NDK)/platforms/$(ANDROID_API)/arch-$(PLATFORM_SHORT_ARCH)/usr/include%' -i.orig config.linux
endif
cd live && patch -lfp1 < ../../src/live555/winstore.patch
cd live && patch -lfp1 < ../../src/live555/no-gettimeofday.patch
mv live $@
touch $@

Loading…
Cancel
Save