aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cfg-common-opts.h2
-rw-r--r--cfg-common.h4
-rwxr-xr-xconfigure2
-rw-r--r--cpudetect.c8
-rw-r--r--get_path.c4
-rw-r--r--libaf/af_ladspa.c11
-rw-r--r--libao2/ao_sdl.c2
-rw-r--r--libdvdread/dvd_reader.c5
-rw-r--r--libdvdread/libdvdread_changes.diff25
-rw-r--r--libvo/video_out.c2
-rw-r--r--mencoder.c10
-rw-r--r--mplayer.c22
-rw-r--r--stream/cache2.c20
-rw-r--r--stream/stream_cddb.c8
-rw-r--r--stream/stream_file.c2
-rw-r--r--stream/stream_vcd.c12
-rw-r--r--subreader.c2
-rw-r--r--vidix/dha.c2
-rw-r--r--vidix/nvidia_vid.c7
19 files changed, 87 insertions, 63 deletions
diff --git a/cfg-common-opts.h b/cfg-common-opts.h
index 6d6374de08..c067b5b4fb 100644
--- a/cfg-common-opts.h
+++ b/cfg-common-opts.h
@@ -15,7 +15,7 @@
{"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
#endif
{"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL},
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
#endif
{"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
diff --git a/cfg-common.h b/cfg-common.h
index 8257b47859..c69deb2cbf 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -349,7 +349,7 @@ const m_option_t msgl_config[]={
};
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
struct {
char* name;
int prio;
@@ -366,7 +366,7 @@ struct {
{ "idle", IDLE_PRIORITY_CLASS},
{ NULL, NORMAL_PRIORITY_CLASS} /* default */
};
-#endif /* WIN32 */
+#endif /* defined(__MINGW32__) || defined(__CYGWIN__) */
extern const m_option_t noconfig_opts[];
diff --git a/configure b/configure
index 5f65481827..be4c133c43 100755
--- a/configure
+++ b/configure
@@ -8227,7 +8227,7 @@ $_def_vcd
#ifdef sun
#define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
#define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
-#elif defined(WIN32) || defined(__OS2__)
+#elif defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
#define DEFAULT_CDROM_DEVICE "D:"
#define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
#elif defined(__APPLE__) || defined(__DARWIN__)
diff --git a/cpudetect.c b/cpudetect.c
index 8ec1adefaa..6d18212662 100644
--- a/cpudetect.c
+++ b/cpudetect.c
@@ -29,7 +29,7 @@ CpuCaps gCpuCaps;
#include <signal.h>
#endif
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#include <windows.h>
#endif
@@ -314,7 +314,7 @@ static void sigill_handler_sse( int signal, struct sigcontext sc )
}
#endif /* __linux__ && _POSIX_SOURCE */
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
{
if(ep->ExceptionRecord->ExceptionCode==EXCEPTION_ILLEGAL_INSTRUCTION){
@@ -325,7 +325,7 @@ LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
}
return EXCEPTION_CONTINUE_SEARCH;
}
-#endif /* WIN32 */
+#endif /* defined(__MINGW32__) || defined(__CYGWIN__) */
#ifdef __OS2__
ULONG _System os2_sig_handler_sse( PEXCEPTIONREPORTRECORD p1,
@@ -395,7 +395,7 @@ static void check_os_katmai_support( void )
gCpuCaps.hasSSE = 0;
mp_msg(MSGT_CPUDETECT,MSGL_WARN, "No OS support for SSE, disabling to be safe.\n" );
#endif
-#elif defined(WIN32)
+#elif defined(__MINGW32__) || defined(__CYGWIN__)
LPTOP_LEVEL_EXCEPTION_FILTER exc_fil;
if ( gCpuCaps.hasSSE ) {
mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
diff --git a/get_path.c b/get_path.c
index 16c93551c8..17520f2a2c 100644
--- a/get_path.c
+++ b/get_path.c
@@ -145,7 +145,7 @@ char *get_path(const char *filename){
return buff;
}
-#if defined(WIN32) && defined(CONFIG_WIN32DLL)
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
void set_path_env()
{
/*make our codec dirs available for LoadLibraryA()*/
@@ -181,4 +181,4 @@ void set_path_env()
if (!SetEnvironmentVariableA("PATH", tmppath))
mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!");
}
-#endif /*WIN32 && CONFIG_WIN32DLL*/
+#endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */
diff --git a/libaf/af_ladspa.c b/libaf/af_ladspa.c
index dadbc45548..97b8982503 100644
--- a/libaf/af_ladspa.c
+++ b/libaf/af_ladspa.c
@@ -296,16 +296,15 @@ static void* mydlopen(const char *filename, int flag) {
size_t filenamelen;
void *result = NULL;
-# ifdef WIN32 /* for windows there's only absolute path support.
- * if you have a windows machine, feel free to fix
- * this. (path separator, shared objects extension,
- * et cetera).
- */
+#if defined(__MINGW32__) || defined(__CYGWIN__)
+ /* For Windows there's only absolute path support.
+ * If you have a Windows machine, feel free to fix this.
+ * (path separator, shared objects extension, et cetera). */
af_msg(AF_MSG_VERBOSE, "\ton windows, only absolute pathnames "
"are supported\n");
af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", filename);
return dlopen(filename, flag);
-# endif
+#endif
filenamelen = strlen(filename);
diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c
index 292972514c..97a70d4adf 100644
--- a/libao2/ao_sdl.c
+++ b/libao2/ao_sdl.c
@@ -52,7 +52,7 @@ LIBAO_EXTERN(sdl)
#undef USE_SDL_INTERNAL_MIXER
// Samplesize used by the SDLlib AudioSpec struct
-#if defined(WIN32) || defined(__AMIGAOS4__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__AMIGAOS4__)
#define SAMPLESIZE 2048
#else
#define SAMPLESIZE 1024
diff --git a/libdvdread/dvd_reader.c b/libdvdread/dvd_reader.c
index 49140544e4..6e75b27693 100644
--- a/libdvdread/dvd_reader.c
+++ b/libdvdread/dvd_reader.c
@@ -438,7 +438,7 @@ dvd_reader_t *DVDOpen( const char *path )
verbose = get_verbose();
-#ifdef WIN32
+#if defined(__CYGWIN__) || defined(__MINGW32__)
/* Stat doesn't work on devices under mingwin/cygwin. */
if( path[0] && path[1] == ':' && path[2] == '\0' )
{
@@ -495,7 +495,8 @@ dvd_reader_t *DVDOpen( const char *path )
/* XXX: We should scream real loud here. */
if( !(path_copy = strdup( path ) ) ) return 0;
-#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
+/* don't have fchdir, and getcwd( NULL, ... ) is strange */
+#if !(defined(__CYGWIN__) || defined(__MINGW32__))
/* Resolve any symlinks and get the absolut dir name. */
{
char *new_path;
diff --git a/libdvdread/libdvdread_changes.diff b/libdvdread/libdvdread_changes.diff
index f0177aa5e5..767e5a6bcb 100644
--- a/libdvdread/libdvdread_changes.diff
+++ b/libdvdread/libdvdread_changes.diff
@@ -42,6 +42,15 @@
/* Loop over all titles and call dvdcss_title to crack the keys. */
static int initAllCSSKeys( dvd_reader_t *dvd )
{
+@@ -438,7 +438,7 @@
+
+ verbose = get_verbose();
+
+-#ifdef WIN32
++#if defined(__CYGWIN__) || defined(__MINGW32__)
+ /* Stat doesn't work on devices under mingwin/cygwin. */
+ if( path[0] && path[1] == ':' && path[2] == '\0' )
+ {
@@ -494,7 +488,7 @@
char *path_copy;
#if defined(SYS_BSD)
@@ -51,7 +60,17 @@
FILE *mntfile;
#endif
-@@ -598,7 +592,7 @@
+@@ -495,7 +495,8 @@
+ /* XXX: We should scream real loud here. */
+ if( !(path_copy = strdup( path ) ) ) return 0;
+
+-#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
++/* don't have fchdir, and getcwd( NULL, ... ) is strange */
++#if !(defined(__CYGWIN__) || defined(__MINGW32__))
+ /* Resolve any symlinks and get the absolut dir name. */
+ {
+ char *new_path;
+@@ -597,7 +592,7 @@
}
fclose( mntfile );
}
@@ -512,3 +531,7 @@
uint16_t next_pgc_nr;
uint16_t prev_pgc_nr;
uint16_t goup_pgc_nr;
+Index: libdvdread/dvd_reader.c
+===================================================================
+--- libdvdread/dvd_reader.c (revision 27759)
++++ libdvdread/dvd_reader.c (working copy)
diff --git a/libvo/video_out.c b/libvo/video_out.c
index 836f7adc1a..5e675042ae 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -214,7 +214,7 @@ const vo_functions_t* const video_out_drivers[] =
#ifdef CONFIG_X11
&video_out_xvidix,
#endif
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
&video_out_winvidix,
#endif
&video_out_cvidix,
diff --git a/mencoder.c b/mencoder.c
index 6ddf5e07e1..bc378673f2 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -30,7 +30,7 @@
#define SIGQUIT 3
#define SIGPIPE 13
#endif
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#include <windows.h>
#endif
@@ -143,7 +143,7 @@ double cur_video_time_usage=0;
double cur_vout_time_usage=0;
int benchmark=0;
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
char * proc_priority=NULL;
#endif
@@ -456,9 +456,9 @@ user_correct_pts = 0;
#endif
#endif
-#if defined(WIN32) && defined(CONFIG_WIN32DLL)
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
set_path_env();
-#endif /*WIN32 && CONFIG_WIN32DLL*/
+#endif
InitTimer();
@@ -516,7 +516,7 @@ if (frameno_filename) {
}
}
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
if(proc_priority){
int i;
for(i=0; priority_presets_defs[i].name; i++){
diff --git a/mplayer.c b/mplayer.c
index 88ea3930f0..92f07fa0a7 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include "config.h"
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#define _UWIN 1 /*disable Non-underscored versions of non-ANSI functions as otherwise int eof would conflict with eof()*/
#include <windows.h>
#endif
@@ -87,7 +87,7 @@ int player_idle_mode=0;
int quiet=0;
int enable_mouse_movements=0;
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
char * proc_priority=NULL;
#endif
@@ -688,7 +688,7 @@ void exit_player_with_rc(const char* how, int rc){
if (mpctx->user_muted && !mpctx->edl_muted) mixer_mute(&mpctx->mixer);
uninit_player(INITIALIZED_ALL);
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
timeEndPeriod(1);
#endif
#ifdef CONFIG_X11
@@ -1207,7 +1207,7 @@ static void print_status(float a_pos, float a_v, float corr)
width = screen_width;
else
width = 80;
-#if defined(WIN32) || defined(__OS2__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
/* Windows command line is broken (MinGW's rxvt works, but we
* should not depend on that). */
width--;
@@ -2571,9 +2571,9 @@ int gui_no_filename=0;
m_config_preparse_command_line(mconfig,argc,argv);
print_version();
-#if defined(WIN32) && defined(CONFIG_WIN32DLL)
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
set_path_env();
-#endif /*WIN32 && CONFIG_WIN32DLL*/
+#endif
#ifdef CONFIG_TV
stream_tv_defaults.immediate = 1;
@@ -2617,7 +2617,7 @@ int gui_no_filename=0;
}
}
-#if defined(WIN32) && defined(CONFIG_GUI)
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_GUI)
void *runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows");
if(runningmplayer && filename && use_gui){
COPYDATASTRUCT csData;
@@ -2632,7 +2632,7 @@ int gui_no_filename=0;
}
#endif
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
// request 1ms timer resolution
timeBeginPeriod(1);
if(proc_priority){
@@ -2652,7 +2652,7 @@ int gui_no_filename=0;
use_gui=0;
}
#else
-#ifndef WIN32
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
if(use_gui && !vo_init()){
mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_GuiNeedsX);
use_gui=0;
@@ -3085,7 +3085,7 @@ if (edl_output_filename) {
char *buf = strdup(filename), *psub;
char *pdot = strrchr(buf, '.');
char *pslash = strrchr(buf, '/');
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
if (!pslash) pslash = strrchr(buf, '\\');
#endif
if (pdot && (!pslash || pdot > pslash))
@@ -3096,7 +3096,7 @@ if (edl_output_filename) {
char *bname;
int l;
bname = strrchr(buf,'/');
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
if(!bname) bname = strrchr(buf,'\\');
#endif
if(bname) bname++;
diff --git a/stream/cache2.c b/stream/cache2.c
index 37889acaa0..dd2423d765 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -18,7 +18,7 @@
#include "osdep/shmem.h"
#include "osdep/timer.h"
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#include <windows.h>
#elif defined(__OS2__)
#define INCL_DOS
@@ -239,7 +239,7 @@ static void cache_execute_control(cache_vars_t *s) {
cache_vars_t* cache_init(int size,int sector){
int num;
-#if !defined(WIN32) && !defined(__OS2__)
+#if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__OS2__)
cache_vars_t* s=shmem_alloc(sizeof(cache_vars_t));
#else
cache_vars_t* s=malloc(sizeof(cache_vars_t));
@@ -253,14 +253,14 @@ cache_vars_t* cache_init(int size,int sector){
}//32kb min_size
s->buffer_size=num*sector;
s->sector_size=sector;
-#if !defined(WIN32) && !defined(__OS2__)
+#if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__OS2__)
s->buffer=shmem_alloc(s->buffer_size);
#else
s->buffer=malloc(s->buffer_size);
#endif
if(s->buffer == NULL){
-#if !defined(WIN32) && !defined(__OS2__)
+#if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__OS2__)
shmem_free(s,sizeof(cache_vars_t));
#else
free(s);
@@ -276,7 +276,7 @@ cache_vars_t* cache_init(int size,int sector){
void cache_uninit(stream_t *s) {
cache_vars_t* c = s->cache_data;
if(!s->cache_pid) return;
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
TerminateThread((HANDLE)s->cache_pid,0);
#elif defined(__OS2__)
DosKillThread( s->cache_pid );
@@ -286,7 +286,7 @@ void cache_uninit(stream_t *s) {
waitpid(s->cache_pid,NULL,0);
#endif
if(!c) return;
-#if defined(WIN32) || defined(__OS2__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
free(c->stream);
free(c->buffer);
free(s->cache_data);
@@ -327,17 +327,17 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
min = s->buffer_size - s->fill_limit;
}
-#if !defined(WIN32) && !defined(__OS2__)
+#if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__OS2__)
if((stream->cache_pid=fork())){
#else
{
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
DWORD threadId;
#endif
stream_t* stream2=malloc(sizeof(stream_t));
memcpy(stream2,s->stream,sizeof(stream_t));
s->stream=stream2;
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
stream->cache_pid = CreateThread(NULL,0,ThreadProc,s,0,&threadId);
#else // OS2
stream->cache_pid = _beginthread( ThreadProc, NULL, 256 * 1024, s );
@@ -359,7 +359,7 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
return 1; // parent exits
}
-#if defined(WIN32) || defined(__OS2__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
}
static void ThreadProc( void *s ){
diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c
index 5236a4ca9c..4702f86d8c 100644
--- a/stream/stream_cddb.c
+++ b/stream/stream_cddb.c
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <string.h>
#include <limits.h>
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#ifdef __MINGW32__
#define mkdir(a,b) mkdir(a)
#endif
@@ -44,7 +44,7 @@
#include <linux/cdrom.h>
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <sys/cdio.h>
-#elif defined(WIN32)
+#elif defined(__MINGW32__) || defined(__CYGWIN__)
#include <ddk/ntddcdrm.h>
#elif (__bsdi__)
#include <dvd.h>
@@ -72,7 +72,7 @@ int
read_toc(const char *dev) {
int first = 0, last = -1;
int i;
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
HANDLE drive;
DWORD r;
CDROM_TOC toc;
@@ -326,7 +326,7 @@ cddb_read_cache(cddb_data_t *cddb_data) {
sprintf( file_name, "%s%08lx", cddb_data->cache_dir, cddb_data->disc_id);
file_fd = open(file_name, O_RDONLY
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
| O_BINARY
#endif
);
diff --git a/stream/stream_file.c b/stream/stream_file.c
index 9b21d80d04..1abc2e1c9e 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -113,7 +113,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
return STREAM_ERROR;
}
-#if defined(WIN32) || defined(__OS2__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
// extract '/' from '/x:/path'
if( filename[ 0 ] == '/' && filename[ 1 ] && filename[ 2 ] == ':' )
filename++;
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c
index 4202a9786d..34844bcea9 100644
--- a/stream/stream_vcd.c
+++ b/stream/stream_vcd.c
@@ -1,7 +1,7 @@
#include "config.h"
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#include <windows.h>
#endif
@@ -14,7 +14,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
-#ifndef WIN32
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
#include <sys/ioctl.h>
#endif
#include <errno.h>
@@ -23,7 +23,7 @@
#include "vcd_read_fbsd.h"
#elif defined(__APPLE__)
#include "vcd_read_darwin.h"
-#elif defined(WIN32)
+#elif defined(__MINGW32__) || defined(__CYGWIN__)
#include "vcd_read_win32.h"
#else
#include "vcd_read.h"
@@ -81,13 +81,13 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
int bsize = VCD_SECTOR_SIZE;
#endif
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
HANDLE hd;
char device[] = "\\\\.\\?:";
#endif
if(mode != STREAM_READ
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
|| GetVersion() > 0x80000000 // Win9x
#endif
) {
@@ -102,7 +102,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
p->device = strdup(DEFAULT_CDROM_DEVICE);
}
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
device[4] = p->device[0];
/* open() can't be used for devices so do it the complicated way */
hd = CreateFile(device, GENERIC_READ, FILE_SHARE_READ, NULL,
diff --git a/subreader.c b/subreader.c
index c64ff460cc..72e050380f 100644
--- a/subreader.c
+++ b/subreader.c
@@ -1836,7 +1836,7 @@ char** sub_filenames(const char* path, char *fname)
subcnt = 0;
tmp = strrchr(fname,'/');
-#if defined(WIN32) || defined(__OS2__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
if(!tmp)tmp = strrchr(fname,'\\');
if(!tmp)tmp = strrchr(fname,':');
#endif
diff --git a/vidix/dha.c b/vidix/dha.c
index 28dc8c8c09..638be29328 100644
--- a/vidix/dha.c
+++ b/vidix/dha.c
@@ -48,7 +48,7 @@
#endif
#include <unistd.h>
-#if defined(WIN32)
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#include "sysdep/libdha_win32.c"
#elif defined (__EMX__)
#include "sysdep/libdha_os2.c"
diff --git a/vidix/nvidia_vid.c b/vidix/nvidia_vid.c
index c53fa93d64..a045b397fe 100644
--- a/vidix/nvidia_vid.c
+++ b/vidix/nvidia_vid.c
@@ -614,13 +614,14 @@ static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){
switch (info->depth) {
case 15:
key = ((r >> 3) << 10) | ((g >> 3) << 5) | ((b >> 3));
-#ifndef WIN32
+
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
key = key | 0x00008000;
#endif
break;
case 16: // XXX unchecked
key = ((r >> 3) << 11) | ((g >> 2) << 5) | ((b >> 3));
-#ifndef WIN32
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
key = key | 0x00008000;
#endif
break;
@@ -629,7 +630,7 @@ static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){
break;
case 32:
key = chromakey;
-#ifndef WIN32
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
key = key | 0x80000000;
#endif
break;