[MPlayer-dev-eng] [PATCH] Darwin & Cygwin fixes
Joey Parrish
joey at yunamusic.com
Mon Jun 3 20:06:40 CEST 2002
Hello,
Attached below are three patches, one to allow configure to accept
gcc versions of the form 2.95.3-5 (as is needed on my Cygwin box),
one to allow mpdvdkit to compile on Cygwin, and one to allow mpdvdkit
to compile on Darwin. I'll start working on VCD support for these
two platforms soon. I hope I'm not duplicating anyone else's patches,
but since none are applied for these problmes I sent them anyway.
Thanks,
--Joey
--
"Yes." -- John F. Kennedy
-------------- next part --------------
--- configure 2002-05-30 09:26:36.000000000 -0500
+++ configure 2002-06-01 01:50:26.000000000 -0500
@@ -381,7 +381,7 @@
echocheck "$_cc version"
cc_name=`$_cc -v 2>&1 | tail -1 | cut -d ' ' -f 1`
#cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'`
- cc_version=`$_cc -dumpversion`
+ cc_version=`$_cc -dumpversion | cut -d '-' -f 1`
case $cc_version in
'')
cc_version="v. ?.??, bad"
-------------- next part --------------
--- configure 2002-05-30 09:26:36.000000000 -0500
+++ configure 2002-06-01 01:50:26.000000000 -0500
@@ -3746,6 +3746,7 @@
if cygwin ; then
_confcygwin='TARGET_CYGWIN = yes'
_def_confwin32='#define WIN32'
+ CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
else
_confcygwin="TARGET_CYGWIN = no"
fi
--- libmpdvdkit/bswap.h 2002-04-24 14:28:04.000000000 -0500
+++ libmpdvdkit/bswap.h 2002-06-01 01:35:46.000000000 -0500
@@ -54,7 +54,7 @@
* functionality!
*/
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__)
+#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(__CYGWIN__)
#define B2N_16(x) \
x = ((((x) & 0xff00) >> 8) | \
(((x) & 0x00ff) << 8))
--- libmpdvdkit/common.h 2002-04-24 14:28:04.000000000 -0500
+++ libmpdvdkit/common.h 2002-06-01 01:39:12.000000000 -0500
@@ -138,7 +138,7 @@
*****************************************************************************/
#ifdef NTOHL_IN_SYS_PARAM_H
# include <sys/param.h>
-#elif defined(WIN32)
+#elif defined(WIN32) && !defined(__CYGWIN__)
# include <winsock.h>
#else
# include <netinet/in.h>
@@ -201,7 +201,7 @@
# define I64C(x) x##LL
#endif
-#if defined( WIN32 )
+#if defined( WIN32 ) && !defined(__CYGWIN__)
# ifndef _OFF_T_DEFINED
typedef __int64 off_t;
# define _OFF_T_DEFINED
--- libmpdvdkit/dvd_reader.c 2002-05-01 04:29:06.000000000 -0500
+++ libmpdvdkit/dvd_reader.c 2002-06-01 01:39:56.000000000 -0500
@@ -40,7 +40,7 @@
#include <mntent.h>
#endif
-#if defined(SYS_BSD)
+#if defined(SYS_BSD) || defined(__CYGWIN__)
typedef off_t off64_t;
#define lseek64 lseek
#define stat64 stat
--- libmpdvdkit/ioctl.h 2002-04-29 16:42:36.000000000 -0500
+++ libmpdvdkit/ioctl.h 2002-06-01 01:46:44.000000000 -0500
@@ -32,6 +32,13 @@
int ioctl_SendChallenge ( int, int *, u8 * );
int ioctl_SendKey2 ( int, int *, u8 * );
+#if defined (__CYGWIN__)
+#include <w32api/windef.h>
+#include <w32api/winnt.h>
+#define va_list void
+#include <w32api/winbase.h>
+#endif
+
/*****************************************************************************
* Common macro, BeOS specific
*****************************************************************************/
--- libmpdvdkit/libdvdcss.c 2002-04-25 14:06:46.000000000 -0500
+++ libmpdvdkit/libdvdcss.c 2002-06-01 01:47:40.000000000 -0500
@@ -34,7 +34,7 @@
#include <fcntl.h>
#include <unistd.h>
-#if defined( WIN32 )
+#if defined( WIN32 ) && !defined(__CYGWIN__)
# include <io.h> /* read() */
#else
# include <sys/uio.h> /* struct iovec */
@@ -43,7 +43,7 @@
#include "config.h"
#include "common.h"
-#if defined( WIN32 )
+#if defined( WIN32 ) && !defined(__CYGWIN__)
# include "input_iovec.h"
#endif
--- loader/wine/windef.h 2001-12-16 18:59:28.000000000 -0600
+++ loader/wine/windef.h 2002-06-01 02:44:42.000000000 -0500
@@ -127,18 +127,24 @@
#define PASCAL __stdcall
#define pascal __stdcall
#define _pascal __stdcall
+#if !defined(__CYGWIN__)
#define _stdcall __stdcall
+#endif
#define _fastcall __stdcall
#define __fastcall __stdcall
#define __export __stdcall
#define CDECL __cdecl
#define _CDECL __cdecl
#define cdecl __cdecl
+#if !defined(__CYGWIN__)
#define _cdecl __cdecl
+#endif
#define WINAPIV __cdecl
#define APIENTRY WINAPI
+#if !defined(__CYGWIN__)
#define __declspec(x)
+#endif
#define dllimport
#define dllexport
-------------- next part --------------
--- libmpdvdkit/dvd_reader.c.orig Wed May 1 04:29:05 2002
+++ libmpdvdkit/dvd_reader.c Mon Jun 3 12:55:16 2002
@@ -46,6 +46,12 @@
#define stat64 stat
#endif
+#if defined(SYS_DARWIN)
+typedef u_int64_t off64_t
+#define lseek64 lseek
+#define stat64 stat
+#endif
+
/* #include "dvdcss.h" */
typedef struct dvdcss_s* dvdcss_handle;
#define DVDCSS_NOFLAGS 0
More information about the MPlayer-dev-eng
mailing list