[MPlayer-cygwin] [PATCH] Gcc4.1 and mingw
Gianluigi Tiesi
mplayer at netfarm.it
Mon Jun 6 07:51:37 CEST 2005
I've managed to compile mplayer with mingw gcc 4.1 snapshot
there are some fixes to made, also I've noticed an old warning
now is an error, the fix is in the patch, it's not so good but I've
no other way to fix it, since the problem is on mingw signed versions
of the defines are yet defined:
so the file ... becomes:
typedef char char;
typedef unsigned char __uint8;
typedef short short;
typedef unsigned short __uint16;
typedef int long;
typedef unsigned int __uint32;
typedef long long long long;
typedef unsigned long long __uint64;
I've no idea about which system defines what but undefining each entry
just before redefining is sure to work as it should.
Other fixes are in vo_directx.c, dx guids cannot be declared static
after declared non static by includes, btw on mingw doesn't make problem
to remove static, Sascha can you check it on cygwin?
The third fix is in dvd device.c, lvalue casting is now an error,
but casting HANDLE to int then re-picking as HANDLE works.
About the aspi stuff I've made it to use the right syntax instead of
genericism of (FARPROC) that doesn't work anymore in gcc4
Bye
--
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
diff -NubBr -xCVS -xhelp_mp.h -x'*.a' -x'*.exe' -x'*.o' -xconfigure.log -xconfig.mak -x.cvsignore -xconfig.h -xcodecs.conf.h -xversion.h -x.depend main/libmpdvdkit2/device.c sherpya/libmpdvdkit2/device.c
--- main/libmpdvdkit2/device.c 2005-03-02 06:34:43.597070400 +0100
+++ sherpya/libmpdvdkit2/device.c 2005-06-06 07:34:45.178574400 +0200
@@ -273,14 +273,14 @@
* won't send back the right result).
* (See Microsoft Q241374: Read and Write Access Required for SCSI
* Pass Through Requests) */
- (HANDLE) dvdcss->i_fd =
+ dvdcss->i_fd = (int)
CreateFile( psz_dvd, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING,
FILE_FLAG_RANDOM_ACCESS, NULL );
if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )
- (HANDLE) dvdcss->i_fd =
+ dvdcss->i_fd = (int)
CreateFile( psz_dvd, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING,
FILE_FLAG_RANDOM_ACCESS, NULL );
@@ -302,8 +302,8 @@
DWORD dwSupportInfo;
struct w32_aspidev *fd;
int i, j, i_hostadapters;
- long (*lpGetSupport)( void );
- long (*lpSendCommand)( void* );
+ GETASPI32SUPPORTINFO lpGetSupport;
+ SENDASPI32COMMAND lpSendCommand;
char c_drive = psz_device[0];
/* load aspi and init w32_aspidev structure */
@@ -314,8 +314,8 @@
return -1;
}
- (FARPROC) lpGetSupport = GetProcAddress( hASPI, "GetASPI32SupportInfo" );
- (FARPROC) lpSendCommand = GetProcAddress( hASPI, "SendASPI32Command" );
+ lpGetSupport = (GETASPI32SUPPORTINFO) GetProcAddress( hASPI, "GetASPI32SupportInfo" );
+ lpSendCommand = (SENDASPI32COMMAND) GetProcAddress( hASPI, "SendASPI32Command" );
if(lpGetSupport == NULL || lpSendCommand == NULL )
{
diff -NubBr -xCVS -xhelp_mp.h -x'*.a' -x'*.exe' -x'*.o' -xconfigure.log -xconfig.mak -x.cvsignore -xconfig.h -xcodecs.conf.h -xversion.h -x.depend main/libmpdvdkit2/ioctl.h sherpya/libmpdvdkit2/ioctl.h
--- main/libmpdvdkit2/ioctl.h 2005-03-02 06:34:44.137848000 +0100
+++ sherpya/libmpdvdkit2/ioctl.h 2005-06-06 07:38:42.850329600 +0200
@@ -318,6 +318,9 @@
* win32 aspi specific
*****************************************************************************/
+typedef WINAPI DWORD (*GETASPI32SUPPORTINFO)(VOID);
+typedef WINAPI DWORD (*SENDASPI32COMMAND)(LPVOID);
+
#define WIN2K ( GetVersion() < 0x80000000 )
#define ASPI_HAID 0
#define ASPI_TARGET 0
@@ -339,7 +342,7 @@
long hASPI;
short i_sid;
int i_blocks;
- long (*lpSendCommand)( void* );
+ SENDASPI32COMMAND lpSendCommand;
};
#pragma pack(1)
diff -NubBr -xCVS -xhelp_mp.h -x'*.a' -x'*.exe' -x'*.o' -xconfigure.log -xconfig.mak -x.cvsignore -xconfig.h -xcodecs.conf.h -xversion.h -x.depend main/libvo/vo_directx.c sherpya/libvo/vo_directx.c
--- main/libvo/vo_directx.c 2005-05-14 07:54:22.470953600 +0200
+++ sherpya/libvo/vo_directx.c 2005-06-06 07:40:04.137214400 +0200
@@ -95,12 +95,12 @@
* Defining them here allows us to get rid of the dxguid library during
* the linking stage.
*****************************************************************************/
-static const GUID IID_IDirectDraw7 =
+const GUID IID_IDirectDraw7 =
{
0x15e65ec0,0x3b9c,0x11d2,{0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b}
};
-static const GUID IID_IDirectDrawColorControl =
+const GUID IID_IDirectDrawColorControl =
{
0x4b9f0ee0,0x0d7e,0x11d0,{0x9b,0x06,0x00,0xa0,0xc9,0x03,0xa3,0xb8}
};
diff -NubBr -xCVS -xhelp_mp.h -x'*.a' -x'*.exe' -x'*.o' -xconfigure.log -xconfig.mak -x.cvsignore -xconfig.h -xcodecs.conf.h -xversion.h -x.depend main/loader/wine/basetsd.h sherpya/loader/wine/basetsd.h
--- main/loader/wine/basetsd.h 2005-04-17 12:35:25.627867200 +0200
+++ sherpya/loader/wine/basetsd.h 2005-06-06 07:41:36.810472000 +0200
@@ -35,17 +35,24 @@
/* Type model indepent typedefs */
#ifndef __INTEL_COMPILER
-
+#undef __int8
typedef char __int8;
+#undef __uint8
typedef unsigned char __uint8;
+#undef __int16
typedef short __int16;
+#undef __uint16
typedef unsigned short __uint16;
+#undef __int32
typedef int __int32;
+#undef __uint32
typedef unsigned int __uint32;
+#undef __int64
typedef long long __int64;
+#undef __uint64
typedef unsigned long long __uint64;
#else
More information about the MPlayer-cygwin
mailing list