[MPlayer-cvslog] r27761 - in trunk: cfg-common-opts.h cfg-common.h configure cpudetect.c get_path.c libaf/af_ladspa.c libao2/ao_sdl.c libdvdread/dvd_reader.c libdvdread/libdvdread_changes.diff libvo/video_out.c mencoder.c mplayer.c stream/cache2.c stream/stream_cddb.c stream/stream_file.c stream/stream_vcd.c subreader.c vidix/dha.c vidix/nvidia_vid.c

diego subversion at mplayerhq.hu
Mon Oct 13 18:23:55 CEST 2008


Author: diego
Date: Mon Oct 13 18:23:55 2008
New Revision: 27761

Log:
Replace preprocessor check for WIN32 with checks for __MINGW32__ and __CYGWIN__.
This avoids a pointless indirection that only obscures what is really done.


Modified:
   trunk/cfg-common-opts.h
   trunk/cfg-common.h
   trunk/configure
   trunk/cpudetect.c
   trunk/get_path.c
   trunk/libaf/af_ladspa.c
   trunk/libao2/ao_sdl.c
   trunk/libdvdread/dvd_reader.c
   trunk/libdvdread/libdvdread_changes.diff
   trunk/libvo/video_out.c
   trunk/mencoder.c
   trunk/mplayer.c
   trunk/stream/cache2.c
   trunk/stream/stream_cddb.c
   trunk/stream/stream_file.c
   trunk/stream/stream_vcd.c
   trunk/subreader.c
   trunk/vidix/dha.c
   trunk/vidix/nvidia_vid.c

Modified: trunk/cfg-common-opts.h
==============================================================================
--- trunk/cfg-common-opts.h	(original)
+++ trunk/cfg-common-opts.h	Mon Oct 13 18:23:55 2008
@@ -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},

Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h	(original)
+++ trunk/cfg-common.h	Mon Oct 13 18:23:55 2008
@@ -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[];
 

Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Mon Oct 13 18:23:55 2008
@@ -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__)

Modified: trunk/cpudetect.c
==============================================================================
--- trunk/cpudetect.c	(original)
+++ trunk/cpudetect.c	Mon Oct 13 18:23:55 2008
@@ -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 sign
 }
 #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(EXCE
    }
    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( voi
    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... " );

Modified: trunk/get_path.c
==============================================================================
--- trunk/get_path.c	(original)
+++ trunk/get_path.c	Mon Oct 13 18:23:55 2008
@@ -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) */

Modified: trunk/libaf/af_ladspa.c
==============================================================================
--- trunk/libaf/af_ladspa.c	(original)
+++ trunk/libaf/af_ladspa.c	Mon Oct 13 18:23:55 2008
@@ -296,16 +296,15 @@ static void* mydlopen(const char *filena
     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);
 

Modified: trunk/libao2/ao_sdl.c
==============================================================================
--- trunk/libao2/ao_sdl.c	(original)
+++ trunk/libao2/ao_sdl.c	Mon Oct 13 18:23:55 2008
@@ -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

Modified: trunk/libdvdread/dvd_reader.c
==============================================================================
--- trunk/libdvdread/dvd_reader.c	(original)
+++ trunk/libdvdread/dvd_reader.c	Mon Oct 13 18:23:55 2008
@@ -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;

Modified: trunk/libdvdread/libdvdread_changes.diff
==============================================================================
--- trunk/libdvdread/libdvdread_changes.diff	(original)
+++ trunk/libdvdread/libdvdread_changes.diff	Mon Oct 13 18:23:55 2008
@@ -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)

Modified: trunk/libvo/video_out.c
==============================================================================
--- trunk/libvo/video_out.c	(original)
+++ trunk/libvo/video_out.c	Mon Oct 13 18:23:55 2008
@@ -214,7 +214,7 @@ const vo_functions_t* const video_out_dr
 #ifdef CONFIG_X11
 	&video_out_xvidix,
 #endif
-#ifdef WIN32
+#if defined(__MINGW32__) || defined(__CYGWIN__)
     &video_out_winvidix,
 #endif
     &video_out_cvidix,

Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c	(original)
+++ trunk/mencoder.c	Mon Oct 13 18:23:55 2008
@@ -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++){

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Mon Oct 13 18:23:55 2008
@@ -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
 
   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, fl
     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++;

Modified: trunk/stream/cache2.c
==============================================================================
--- trunk/stream/cache2.c	(original)
+++ trunk/stream/cache2.c	Mon Oct 13 18:23:55 2008
@@ -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_
 
 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 se
   }//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 se
 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
      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
     return 1; // parent exits
   }
   
-#if defined(WIN32) || defined(__OS2__)
+#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__)
 }
 
 static void ThreadProc( void *s ){

Modified: trunk/stream/stream_cddb.c
==============================================================================
--- trunk/stream/stream_cddb.c	(original)
+++ trunk/stream/stream_cddb.c	Mon Oct 13 18:23:55 2008
@@ -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
 	);

Modified: trunk/stream/stream_file.c
==============================================================================
--- trunk/stream/stream_file.c	(original)
+++ trunk/stream/stream_file.c	Mon Oct 13 18:23:55 2008
@@ -113,7 +113,7 @@ static int open_f(stream_t *stream,int m
     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++;

Modified: trunk/stream/stream_vcd.c
==============================================================================
--- trunk/stream/stream_vcd.c	(original)
+++ trunk/stream/stream_vcd.c	Mon Oct 13 18:23:55 2008
@@ -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 m
 #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 m
       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,

Modified: trunk/subreader.c
==============================================================================
--- trunk/subreader.c	(original)
+++ trunk/subreader.c	Mon Oct 13 18:23:55 2008
@@ -1836,7 +1836,7 @@ char** sub_filenames(const char* path, c
     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

Modified: trunk/vidix/dha.c
==============================================================================
--- trunk/vidix/dha.c	(original)
+++ trunk/vidix/dha.c	Mon Oct 13 18:23:55 2008
@@ -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"

Modified: trunk/vidix/nvidia_vid.c
==============================================================================
--- trunk/vidix/nvidia_vid.c	(original)
+++ trunk/vidix/nvidia_vid.c	Mon Oct 13 18:23:55 2008
@@ -614,13 +614,14 @@ static void rivatv_overlay_colorkey (riv
 	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 (riv
 		break;
 	case 32:
 		key = chromakey;
-#ifndef WIN32
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
         key = key | 0x80000000;
 #endif       
 		break;



More information about the MPlayer-cvslog mailing list