[MPlayer-cygwin] [PATCH] live.com on mingw

Joey Parrish joey at nicewarrior.org
Tue Apr 20 02:19:04 CEST 2004


On Mon, Apr 19, 2004 at 07:15:47PM -0500, Joey Parrish wrote:
> I've got two patches here that get live.com+MPlayer compiled under mingw.
> Only tested briefly under mingw.  Not tested at all for cygwin.
> Please test.  If I get good feedback, I'll ask -dev-eng to commit them.

I apologize for the double-mail (especially for the CC if Ross is on
this list...) but I think I must be the most absent-minded dev around.
Most of the patches I've sent to this list I forgot to attach to my
first message.  This time, patches for real.

> live.mingw.diff applies to live.com 2004-04-09.
> mplayer-live.mingw.diff applies to MPlayer CVS 2004-04-19.
> 
> live.mingw.diff:
>  @ part 1: fixed what appears to be a typo
>  @ part 2: same typo, different file
>  @ part 3: include winsock2 header (does this work for cygwin, too?)
>  @ part 4: make sure windows.h doesn't eventually include ole2.h (hack)
> 
> mplayer-live.mingw.diff:
>  @ part 1: add winsock library to LIVE_LIBS (do I need this for cygwin?)
>  @ part 2: include windows.h at the top of demux_rtp
>  @ part 3: protect stheader from definition conflicts with windows.h
>  @ part 4: protect loader's windef.h the same way

--Joey

-- 
"Living in the complex world of the future is somewhat
like having bees live in your head.  But, there they are."
-------------- next part --------------
diff -ur live/groupsock/Groupsock.cpp live.com/groupsock/Groupsock.cpp
--- live/groupsock/Groupsock.cpp	Fri Apr  9 18:03:04 2004
+++ live.com/groupsock/Groupsock.cpp	Mon Apr 19 20:38:01 2004
@@ -24,7 +24,7 @@
 #include "TunnelEncaps.hh"
 
 #if defined(__WIN32__) || defined(_WIN32)
-#include <strstrea.h>
+#include <strstream.h>
 #else
 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
 #include <strstream>
diff -ur live/groupsock/NetInterface.cpp live.com/groupsock/NetInterface.cpp
--- live/groupsock/NetInterface.cpp	Fri Apr  9 18:03:04 2004
+++ live.com/groupsock/NetInterface.cpp	Mon Apr 19 20:38:28 2004
@@ -22,7 +22,7 @@
 #include "GroupsockHelper.hh"
 
 #if defined(__WIN32__) || defined(_WIN32)
-#include <strstrea.h>
+#include <strstream.h>
 #else
 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
 #include <strstream>
diff -ur live/groupsock/include/GroupsockHelper.hh live.com/groupsock/include/GroupsockHelper.hh
--- live/groupsock/include/GroupsockHelper.hh	Fri Apr  9 18:03:04 2004
+++ live.com/groupsock/include/GroupsockHelper.hh	Mon Apr 19 20:37:06 2004
@@ -25,6 +25,10 @@
 #include "NetAddress.hh"
 #endif
 
+#if defined(__WIN32__) || defined(_WIN32)
+#include <ws2tcpip.h>
+#endif
+
 int setupDatagramSocket(UsageEnvironment& env,
 			Port port, Boolean setLoopback = True);
 int setupStreamSocket(UsageEnvironment& env,
diff -ur live/groupsock/include/NetCommon.h live.com/groupsock/include/NetCommon.h
--- live/groupsock/include/NetCommon.h	Fri Apr  9 18:03:04 2004
+++ live.com/groupsock/include/NetCommon.h	Mon Apr 19 23:04:46 2004
@@ -33,6 +33,7 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #endif
+#define _OLE2_H /* HACK */
 #include <windows.h>
 
 #define _close closesocket
-------------- next part --------------
diff -ur main.cvs/configure main.dev/configure
--- main.cvs/configure	Mon Apr 19 21:35:51 2004
+++ main.dev/configure	Mon Apr 19 23:36:19 2004
@@ -4975,6 +4975,10 @@
 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
 LIVE_LIBS += -lstdc++"
+  if mingw ; then
+    _live_libs_def="$_live_libs_def
+LIVE_LIBS += -lws2_32"
+  fi
   _ld_live='$(LIVE_LIBS)'
  _inputmodules="live.com $_inputmodules"
 else
diff -ur main.cvs/libmpdemux/demux_rtp.cpp main.dev/libmpdemux/demux_rtp.cpp
--- main.cvs/libmpdemux/demux_rtp.cpp	Fri Mar 19 10:15:41 2004
+++ main.dev/libmpdemux/demux_rtp.cpp	Mon Apr 19 23:51:18 2004
@@ -2,6 +2,10 @@
 ////////// and the "LIVE.COM Streaming Media" libraries:
 
 extern "C" {
+// on mingw, we must include windows.h before the things it conflicts
+#ifdef __MINGW32__    // with.  they are each protected from from
+#include <windows.h>  // windows.h, but not the other way around.
+#endif
 #include "demux_rtp.h"
 #include "stheader.h"
 }
diff -ur main.cvs/libmpdemux/stheader.h main.dev/libmpdemux/stheader.h
--- main.cvs/libmpdemux/stheader.h	Thu Jan 16 22:34:46 2003
+++ main.dev/libmpdemux/stheader.h	Mon Apr 19 23:08:43 2004
@@ -4,6 +4,9 @@
 // for AVIStreamHeader:
 #include "wine/avifmt.h"
 
+#ifndef _WINGDI_H
+#define _WINGDI_H
+
 #ifndef _WAVEFORMATEX_
 #define _WAVEFORMATEX_
 typedef struct __attribute__((__packed__)) _WAVEFORMATEX {
@@ -39,6 +42,8 @@
 } BITMAPINFO, *LPBITMAPINFO;
 #endif
 
+
+#endif /* _WINGDI_H (hack) */
 // Stream headers:
 
 typedef struct {
diff -ur main.cvs/loader/wine/windef.h main.dev/loader/wine/windef.h
--- main.cvs/loader/wine/windef.h	Thu Apr 24 18:48:30 2003
+++ main.dev/loader/wine/windef.h	Mon Apr 19 22:53:53 2004
@@ -4,6 +4,9 @@
  * Copyright 1996 Alexandre Julliard
  */
 
+#ifndef _WINDEF_H
+#define _WINDEF_H
+
 #ifndef __WINE_WINDEF_H
 #define __WINE_WINDEF_H
 
@@ -672,3 +675,5 @@
 #endif
 
 #endif /* __WINE_WINDEF_H */
+
+#endif /* _WINDEF_H (hack) */


More information about the MPlayer-cygwin mailing list