
Attached is a patch which adds support
for ms c(pp) compiler and intel c(pp)
compiler.

-- 
Jon Johansen
nanocrew.net


-- Attached file included as plaintext by Listar --

diff -urN vlc.cvs/include/common.h vlc/include/common.h
--- vlc.cvs/include/common.h	Wed May 30 19:03:12 2001
+++ vlc/include/common.h	Thu May 31 00:59:10 2001
@@ -144,6 +144,7 @@
 #ifdef NTOHL_IN_SYS_PARAM_H
 #   include <sys/param.h>
 #elif defined(WIN32)
+#   include <winsock.h>
 #else
 #   include <netinet/in.h>
 #endif
@@ -190,3 +191,18 @@
 #define U32_AT(p)   ( ntoh32 ( *( (u32 *)(p) ) ) )
 #define U16_AT(p)   ( ntoh16 ( *( (u16 *)(p) ) ) )
 
+/* win32, cl and icl support */
+#if defined( _MSC_VER )
+typedef long off_t;
+#define __attribute__(x)
+#define __inline__      __inline
+#define strncasecmp     strnicmp
+#define strcasecmp      stricmp
+#define S_ISBLK(m)      (0)
+#define S_ISCHR(m)      (0)
+#define S_ISFIFO(m)     (((m)&_S_IFMT) == _S_IFIFO)
+#define S_ISREG(m)      (((m)&_S_IFMT) == _S_IFREG)
+#define I64C(x)         x
+#else
+#define I64C(x)         x##LL
+#endif
diff -urN vlc.cvs/include/int_types.h vlc/include/int_types.h
--- vlc.cvs/include/int_types.h	Wed Mar 21 14:42:34 2001
+++ vlc/include/int_types.h	Thu May 31 00:29:10 2001
@@ -28,5 +28,10 @@
 typedef signed short            s16;
 typedef unsigned int            u32;
 typedef signed int              s32;
+#if defined( _MSC_VER )
+typedef unsigned __int64        u64;
+typedef signed __int64          s64;
+#else
 typedef unsigned long long      u64;
 typedef signed long long        s64;
+#endif
diff -urN vlc.cvs/include/intf_msg.h vlc/include/intf_msg.h
--- vlc.cvs/include/intf_msg.h	Mon Apr 30 17:01:00 2001
+++ vlc/include/intf_msg.h	Thu May 31 00:29:10 2001
@@ -48,8 +48,13 @@
 #else
 
 /* Non-TRACE mode */
+#if defined( _MSC_VER )
+#define intf_DbgMsg
+#define intf_DbgMsgImm
+#else
 #define intf_DbgMsg( format, args... )
 #define intf_DbgMsgImm( format, args...)
+#endif
 
 #endif
 
diff -urN vlc.cvs/include/iovec.h vlc/include/iovec.h
--- vlc.cvs/include/iovec.h	Thu Jan  1 01:00:00 1970
+++ vlc/include/iovec.h	Thu May 31 00:29:10 2001
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ * iovec.h: iovec struct and readv
+ *****************************************************************************
+ * Copyright (C) 2001 VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+struct iovec
+{
+    void *iov_base;     /* Pointer to data. */
+    size_t iov_len;     /* Length of data.  */
+};
+
+#if defined( WIN32 )
+
+static __inline int readv( int i_fd, struct iovec *p_iovec, int i_count )
+{
+    int i_index, i_len, i_total = 0;
+    char *p_base;
+
+    for( i_index = i_count; i_index; i_index-- )
+    {
+        i_len  = p_iovec->iov_len;
+        p_base = p_iovec->iov_base;
+
+        while( i_len > 0 )
+        {
+            register signed int i_bytes;
+            i_bytes = read( i_fd, p_base, i_len );
+
+            if( i_total == 0 )
+            {
+                if( i_bytes < 0 )
+                {
+                    return -1;
+                }
+            }
+
+            if( i_bytes <= 0 )
+            {
+                return i_total;
+            }
+
+            i_len   -= i_bytes;
+            i_total += i_bytes;
+            p_base  += i_bytes;
+        }
+
+        p_iovec++;
+    }
+
+    return i_total;
+}
+
+#endif
\ No newline at end of file
diff -urN vlc.cvs/plugins/dummy/aout_dummy.c vlc/plugins/dummy/aout_dummy.c
--- vlc.cvs/plugins/dummy/aout_dummy.c	Wed May 30 19:03:12 2001
+++ vlc/plugins/dummy/aout_dummy.c	Thu May 31 00:29:10 2001
@@ -50,7 +50,9 @@
  *****************************************************************************/
 typedef struct aout_sys_s
 {
-
+#if defined( _MSC_VER )
+    int dummy;
+#endif
 } aout_sys_t;
 
 /*****************************************************************************
diff -urN vlc.cvs/plugins/dummy/intf_dummy.c vlc/plugins/dummy/intf_dummy.c
--- vlc.cvs/plugins/dummy/intf_dummy.c	Wed May 30 19:03:12 2001
+++ vlc/plugins/dummy/intf_dummy.c	Thu May 31 00:29:10 2001
@@ -50,7 +50,9 @@
  *****************************************************************************/
 typedef struct intf_sys_s
 {
-
+#if defined( _MSC_VER )
+    int dummy;
+#endif
 } intf_sys_t;
 
 /*****************************************************************************
diff -urN vlc.cvs/plugins/dvd/dvd_css.c vlc/plugins/dvd/dvd_css.c
--- vlc.cvs/plugins/dvd/dvd_css.c	Sat May 19 02:39:30 2001
+++ vlc/plugins/dvd/dvd_css.c	Thu May 31 00:29:10 2001
@@ -36,7 +36,13 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
 #include <string.h>
 
 #include "common.h"
diff -urN vlc.cvs/plugins/dvd/dvd_ifo.c vlc/plugins/dvd/dvd_ifo.c
--- vlc.cvs/plugins/dvd/dvd_ifo.c	Sat May 19 02:39:30 2001
+++ vlc/plugins/dvd/dvd_ifo.c	Thu May 31 00:32:56 2001
@@ -34,7 +34,13 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
 #include <string.h>
 #include <fcntl.h>
 
diff -urN vlc.cvs/plugins/dvd/dvd_ioctl.c vlc/plugins/dvd/dvd_ioctl.c
--- vlc.cvs/plugins/dvd/dvd_ioctl.c	Sun May 27 17:16:58 2001
+++ vlc/plugins/dvd/dvd_ioctl.c	Thu May 31 00:29:10 2001
@@ -29,9 +29,11 @@
 
 #include <string.h>                                    /* memcpy(), memset() */
 #include <sys/types.h>
-#include <netinet/in.h>
 
+#if !defined( WIN32 )
+#include <netinet/in.h>
 #include <sys/ioctl.h>
+#endif
 
 #ifdef DVD_STRUCT_IN_SYS_CDIO_H
 #   include <sys/cdio.h>
diff -urN vlc.cvs/plugins/dvd/dvd_netlist.c vlc/plugins/dvd/dvd_netlist.c
--- vlc.cvs/plugins/dvd/dvd_netlist.c	Fri Apr  6 11:15:48 2001
+++ vlc/plugins/dvd/dvd_netlist.c	Thu May 31 00:29:10 2001
@@ -35,8 +35,17 @@
 #include <stdlib.h>
 #include <string.h>                                    /* memcpy(), memset() */
 #include <sys/types.h>
-#include <sys/uio.h>                                         /* struct iovec */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
+#if !defined( WIN32 )
+#include <sys/uio.h>                                         /* struct iovec */
+#else
+#include <io.h>
+#include "iovec.h"
+#endif
 
 #include "config.h"
 #include "common.h"
diff -urN vlc.cvs/plugins/dvd/dvd_summary.c vlc/plugins/dvd/dvd_summary.c
--- vlc.cvs/plugins/dvd/dvd_summary.c	Sat May 19 02:39:30 2001
+++ vlc/plugins/dvd/dvd_summary.c	Thu May 31 00:29:10 2001
@@ -36,12 +36,17 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
+#if !defined( WIN32 )
 #include <netinet/in.h>
+#endif
 
 #include <fcntl.h>
 #include <sys/types.h>
-#include <sys/uio.h>
 
 #include <string.h>
 #ifdef STRNCASECMP_IN_STRINGS_H
diff -urN vlc.cvs/plugins/dvd/dvd_udf.c vlc/plugins/dvd/dvd_udf.c
--- vlc.cvs/plugins/dvd/dvd_udf.c	Sat Apr 28 05:36:26 2001
+++ vlc/plugins/dvd/dvd_udf.c	Thu May 31 00:33:08 2001
@@ -41,7 +41,13 @@
 #include "modules_inner.h"
 
 #include <stdio.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
 #include <string.h>
 #ifdef STRNCASECMP_IN_STRINGS_H
 #   include <strings.h>
diff -urN vlc.cvs/plugins/dvd/input_dvd.c vlc/plugins/dvd/input_dvd.c
--- vlc.cvs/plugins/dvd/input_dvd.c	Thu May 31 00:16:08 2001
+++ vlc/plugins/dvd/input_dvd.c	Thu May 31 00:29:10 2001
@@ -43,12 +43,17 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
+#if !defined( WIN32 )
 #include <netinet/in.h>
+#endif
 
 #include <fcntl.h>
 #include <sys/types.h>
-#include <sys/uio.h>
 
 #include <string.h>
 #ifdef STRNCASECMP_IN_STRINGS_H
@@ -56,6 +61,13 @@
 #endif
 #include <errno.h>
 
+#if !defined( WIN32 )
+#include <sys/uio.h>                                         /* struct iovec */
+#else
+#include <io.h>
+#include "iovec.h"
+#endif
+
 #include "config.h"
 #include "common.h"
 #include "threads.h"
@@ -785,7 +797,7 @@
     thread_dvd_data_t *     p_dvd;
     dvd_netlist_t *         p_netlist;
     struct iovec *          p_vec;
-    struct data_packet_s *  pp_data[p_input->i_read_once];
+    struct data_packet_s ** pp_data;
     u8 *                    pi_cur;
     int                     i_block_once;
     int                     i_packet_size;
@@ -798,6 +810,14 @@
     boolean_t               b_eof;
     boolean_t               b_eot;
 
+    pp_data = (struct data_packet_s **) malloc( p_input->i_read_once *
+                                        sizeof( struct data_packet_s * ) );
+    if( pp_data == NULL )
+    {
+        intf_ErrMsg( "dvd error: out of memory" );
+        return -1;
+    }
+
     p_dvd = (thread_dvd_data_t *)p_input->p_plugin_data;
     p_netlist = (dvd_netlist_t *)p_input->p_method_data;
 
@@ -805,6 +825,7 @@
     if( ( p_vec = DVDGetiovec( p_netlist ) ) == NULL )
     {
         intf_ErrMsg( "dvd error: can't get iovec" );
+        free( pp_data );
         return -1;
     }
 
@@ -823,6 +844,7 @@
         {
             pp_packets[0] = NULL;
             intf_ErrMsg( "dvd error: can't find next cell" );
+            free( pp_data );
             return 1;
         }
 
@@ -900,7 +922,7 @@
 
         while( i_pos < p_netlist->i_buffer_size )
         {
-            pi_cur = (u8*)(p_vec[i_iovec].iov_base + i_pos);
+            pi_cur = ((u8*)p_vec[i_iovec].iov_base + i_pos);
 
             /*default header */
             if( U32_AT( pi_cur ) != 0x1BA )
@@ -925,6 +947,7 @@
                 else
                 {
                     intf_ErrMsg( "Unable to determine stream type" );
+                    free( pp_data );
                     return( -1 );
                 }
 
@@ -961,6 +984,8 @@
     b_eof = b_eot && ( ( p_dvd->i_title + 1 ) >= p_input->stream.i_area_nb );
 
     vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+    free( pp_data );
 
     if( b_eof )
     {
diff -urN vlc.cvs/plugins/mpeg/input_es.c vlc/plugins/mpeg/input_es.c
--- vlc.cvs/plugins/mpeg/input_es.c	Wed May 30 19:03:12 2001
+++ vlc/plugins/mpeg/input_es.c	Thu May 31 00:29:10 2001
@@ -35,7 +35,13 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
 #include <fcntl.h>
 
 #include "config.h"
diff -urN vlc.cvs/plugins/mpeg/input_ps.c vlc/plugins/mpeg/input_ps.c
--- vlc.cvs/plugins/mpeg/input_ps.c	Wed May 30 19:03:12 2001
+++ vlc/plugins/mpeg/input_ps.c	Thu May 31 00:29:10 2001
@@ -39,7 +39,13 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
 #include <fcntl.h>
 
 #include "config.h"
diff -urN vlc.cvs/plugins/mpeg/input_ps.h vlc/plugins/mpeg/input_ps.h
--- vlc.cvs/plugins/mpeg/input_ps.h	Tue May  8 02:43:58 2001
+++ vlc/plugins/mpeg/input_ps.h	Thu May 31 00:29:10 2001
@@ -22,6 +22,10 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#if defined( _MSC_VER )
+#undef small
+#endif
+
 /*****************************************************************************
  * thread_ps_data_t: extension of input_thread_t
  *****************************************************************************/
diff -urN vlc.cvs/plugins/mpeg/input_ts.c vlc/plugins/mpeg/input_ts.c
--- vlc.cvs/plugins/mpeg/input_ts.c	Wed May 30 19:03:12 2001
+++ vlc/plugins/mpeg/input_ts.c	Thu May 31 00:29:10 2001
@@ -37,25 +37,29 @@
 #include <errno.h>
 
 #include <sys/types.h>
+
+#if !defined( _MSC_VER )
 #include <sys/time.h>
+#endif
 
 #ifdef SYS_NTO
 #include <sys/select.h>
 #endif
 
-#ifndef WIN32 
-#   include <sys/uio.h>                                      /* struct iovec */
-#else
-    struct iovec
-    {
-        void *iov_base; /* Pointer to data.  */
-        size_t iov_len; /* Length of data.  */
-    };
-#endif
-
 #include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
 #include <fcntl.h>
+
+#if !defined( WIN32 )
+#include <sys/uio.h>                                         /* struct iovec */
+#else
+#include <io.h>
+#include "iovec.h"
+#endif
 
 #include "config.h"
 #include "common.h"
diff -urN vlc.cvs/plugins/mpeg/input_ts.h vlc/plugins/mpeg/input_ts.h
--- vlc.cvs/plugins/mpeg/input_ts.h	Mon May 28 06:23:52 2001
+++ vlc/plugins/mpeg/input_ts.h	Thu May 31 00:29:10 2001
@@ -32,46 +32,3 @@
     fd_set s_fdset;
     
 } thread_ts_data_t;
-
-#ifdef WIN32
-static __inline__ int readv( int i_fd, struct iovec *p_iovec, int i_count )
-{
-    int i_index, i_len, i_total = 0;
-    char *p_base;
-
-    for( i_index = i_count; i_index; i_index-- )
-    {
-        i_len  = p_iovec->iov_len;
-        p_base = p_iovec->iov_base;
-
-        while( i_len > 0 )
-        {
-            register signed int i_bytes;
-            i_bytes = read( i_fd, p_base, i_len );
-
-            if( i_total == 0 )
-            {
-                if( i_bytes < 0 )
-                {
-                    intf_ErrMsg( "input error: read failed on socket" );
-                    return -1;
-                }
-            }
-
-            if( i_bytes <= 0 )
-            {
-                return i_total;
-            }
-
-            i_len   -= i_bytes;
-            i_total += i_bytes;
-            p_base  += i_bytes;
-        }
-
-        p_iovec++;
-    }
-
-    return i_total;
-}
-#endif
-
diff -urN vlc.cvs/src/ac3_decoder/ac3_decoder_thread.c vlc/src/ac3_decoder/ac3_decoder_thread.c
--- vlc.cvs/src/ac3_decoder/ac3_decoder_thread.c	Tue May 15 18:19:42 2001
+++ vlc/src/ac3_decoder/ac3_decoder_thread.c	Thu May 31 00:29:10 2001
@@ -35,7 +35,9 @@
  *****************************************************************************/
 #include "defs.h"
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* getpid() */
+#endif
 
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>                                              /* memset() */
diff -urN vlc.cvs/src/ac3_spdif/ac3_iec958.c vlc/src/ac3_spdif/ac3_iec958.c
--- vlc.cvs/src/ac3_spdif/ac3_iec958.c	Sun May  6 20:32:30 2001
+++ vlc/src/ac3_spdif/ac3_iec958.c	Thu May 31 00:29:10 2001
@@ -32,7 +32,10 @@
 #include <stdlib.h>
 #include <string.h>                                              /* memset() */
 #include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "config.h"
 #include "common.h"
diff -urN vlc.cvs/src/ac3_spdif/ac3_spdif.c vlc/src/ac3_spdif/ac3_spdif.c
--- vlc.cvs/src/ac3_spdif/ac3_spdif.c	Wed May 30 07:19:04 2001
+++ vlc/src/ac3_spdif/ac3_spdif.c	Thu May 31 00:32:00 2001
@@ -32,7 +32,10 @@
 #include <stdlib.h>
 #include <string.h>                                              /* memcpy() */
 #include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "config.h"
 #include "common.h"
@@ -204,8 +207,8 @@
                 m_last_pts;
     
             /* Write in the first free packet of aout fifo */
-            p_spdif->p_iec = (p_spdif->p_aout_fifo->buffer) + 
-                (p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME_SIZE );
+            p_spdif->p_iec = ((u8*)(p_spdif->p_aout_fifo->buffer) + 
+                (p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME_SIZE ));
     
             /* Build burst to be sent to hardware decoder */
             ac3_iec958_build_burst( p_spdif );
diff -urN vlc.cvs/src/audio_decoder/audio_decoder.c vlc/src/audio_decoder/audio_decoder.c
--- vlc.cvs/src/audio_decoder/audio_decoder.c	Tue May  1 06:18:18 2001
+++ vlc/src/audio_decoder/audio_decoder.c	Thu May 31 00:29:10 2001
@@ -36,7 +36,9 @@
  *****************************************************************************/
 #include "defs.h"
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* getpid() */
+#endif
 
 #include <stdio.h>                                           /* "intf_msg.h" */
 #include <string.h>                                    /* memcpy(), memset() */
diff -urN vlc.cvs/src/audio_output/aout_spdif.c vlc/src/audio_output/aout_spdif.c
--- vlc.cvs/src/audio_output/aout_spdif.c	Wed May 30 07:19:04 2001
+++ vlc/src/audio_output/aout_spdif.c	Thu May 31 00:32:00 2001
@@ -115,9 +115,9 @@
                         mlast = mplay;
                         /* play spdif frame to the external decoder */
                         p_aout->pf_play( p_aout,
-                                         p_aout->fifo[i_fifo].buffer +
+                                         ((byte_t*) p_aout->fifo[i_fifo].buffer +
                                             p_aout->fifo[i_fifo].l_start_frame*
-                                            SPDIF_FRAME_SIZE,
+                                            SPDIF_FRAME_SIZE ),
                                          p_aout->fifo[i_fifo].l_frame_size );
 
                         p_aout->fifo[i_fifo].l_start_frame = 
diff -urN vlc.cvs/src/audio_output/audio_output.c vlc/src/audio_output/audio_output.c
--- vlc.cvs/src/audio_output/audio_output.c	Wed May 30 07:19:04 2001
+++ vlc/src/audio_output/audio_output.c	Thu May 31 00:29:10 2001
@@ -38,7 +38,10 @@
  *****************************************************************************/
 #include "defs.h"
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* getpid() */
+#endif
+
 #ifdef WIN32                   /* getpid() for win32 is located in process.h */
 #include <process.h>
 #endif
diff -urN vlc.cvs/src/input/input.c vlc/src/input/input.c
--- vlc.cvs/src/input/input.c	Thu May 31 00:16:08 2001
+++ vlc/src/input/input.c	Thu May 31 00:29:10 2001
@@ -32,7 +32,13 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
 #include <string.h>
 #ifdef STRNCASECMP_IN_STRINGS_H
 #   include <strings.h>
@@ -231,6 +237,7 @@
 static void RunThread( input_thread_t *p_input )
 {
     int                     i_error, i;
+    data_packet_t **        pp_packets;
 
     if( InitThread( p_input ) )
     {
@@ -248,10 +255,16 @@
     p_input->stream.b_changed = 1;
     vlc_mutex_unlock( &p_input->stream.stream_lock );
 
-    while( !p_input->b_die && !p_input->b_error && !p_input->b_eof )
+    pp_packets = (data_packet_t **) malloc( p_input->i_read_once *
+                                        sizeof( data_packet_t * ) );
+    if( pp_packets == NULL )
     {
-        data_packet_t *         pp_packets[p_input->i_read_once];
+        intf_ErrMsg( "input error: out of memory" );
+        p_input->b_error = 1;
+    }
 
+    while( !p_input->b_die && !p_input->b_error && !p_input->b_eof )
+    {
 #ifdef STATS
         p_input->c_loops++;
 #endif
@@ -324,6 +337,8 @@
         }
     }
 
+    free( pp_packets );
+
     if( p_input->b_error || p_input->b_eof )
     {
         ErrorThread( p_input );
@@ -717,7 +732,7 @@
     /* We may want to reuse an already used socket */
     i_opt = 1;
     if( setsockopt( p_input->i_handle, SOL_SOCKET, SO_REUSEADDR,
-                    &i_opt, sizeof( i_opt ) ) == -1 )
+                    (void*) &i_opt, sizeof( i_opt ) ) == -1 )
     {
         intf_ErrMsg( "input error: can't configure socket (SO_REUSEADDR: %s)",
                      strerror(errno));
@@ -730,7 +745,7 @@
      * packet loss caused by scheduling problems */
     i_opt = 0x80000;
     if( setsockopt( p_input->i_handle, SOL_SOCKET, SO_RCVBUF,
-                    &i_opt, sizeof( i_opt ) ) == -1 )
+                    (void*) &i_opt, sizeof( i_opt ) ) == -1 )
     {
         intf_ErrMsg( "input error: can't configure socket (SO_RCVBUF: %s)", 
                      strerror(errno));
diff -urN vlc.cvs/src/input/input_netlist.c vlc/src/input/input_netlist.c
--- vlc.cvs/src/input/input_netlist.c	Mon May 28 06:23:52 2001
+++ vlc/src/input/input_netlist.c	Thu May 31 00:29:10 2001
@@ -29,16 +29,16 @@
 #include <stdlib.h>
 #include <string.h>                                    /* memcpy(), memset() */
 #include <sys/types.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
-#ifndef WIN32 
-#   include <sys/uio.h>                                      /* struct iovec */
+#if !defined( WIN32 )
+#include <sys/uio.h>                                         /* struct iovec */
 #else
-    struct iovec
-    {
-        void *iov_base; /* Pointer to data.  */
-        size_t iov_len; /* Length of data.  */
-    };
+#include <io.h>
+#include "iovec.h"
 #endif
 
 #include "config.h"
diff -urN vlc.cvs/src/interface/intf_msg.c vlc/src/interface/intf_msg.c
--- vlc.cvs/src/interface/intf_msg.c	Mon May  7 05:14:10 2001
+++ vlc/src/interface/intf_msg.c	Thu May 31 00:29:10 2001
@@ -34,7 +34,10 @@
 #include <stdarg.h>                                       /* va_list for BSD */
 #include <stdlib.h>                                              /* malloc() */
 #include <string.h>                                            /* strerror() */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                      /* close(), write() */
+#endif
 
 #include "config.h"
 #include "common.h"
diff -urN vlc.cvs/src/interface/main.c vlc/src/interface/main.c
--- vlc.cvs/src/interface/main.c	Wed May 30 07:19:04 2001
+++ vlc/src/interface/main.c	Thu May 31 00:29:10 2001
@@ -51,7 +51,10 @@
 #include <netinet/in.h>                               /* BSD: struct in_addr */
 #endif
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdlib.h>                                  /* getenv(), strtol(),  */
 #include <string.h>                                            /* strerror() */
diff -urN vlc.cvs/src/lpcm_decoder/lpcm_decoder_thread.c vlc/src/lpcm_decoder/lpcm_decoder_thread.c
--- vlc.cvs/src/lpcm_decoder/lpcm_decoder_thread.c	Tue May  1 06:18:18 2001
+++ vlc/src/lpcm_decoder/lpcm_decoder_thread.c	Thu May 31 00:29:10 2001
@@ -26,7 +26,9 @@
  *****************************************************************************/
 #include "defs.h"
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* getpid() */
+#endif
 
 #include <stdio.h>                                           /* "intf_msg.h" */
 #include <string.h>                                    /* memcpy(), memset() */
diff -urN vlc.cvs/src/misc/modules.c vlc/src/misc/modules.c
--- vlc.cvs/src/misc/modules.c	Wed May 30 19:03:12 2001
+++ vlc/src/misc/modules.c	Thu May 31 00:29:10 2001
@@ -34,7 +34,10 @@
 #include <stdlib.h>                                      /* free(), strtol() */
 #include <stdio.h>                                              /* sprintf() */
 #include <string.h>                                              /* strdup() */
+
+#if !defined( _MSC_VER )
 #include <dirent.h>
+#endif
 
 #if defined(HAVE_DLFCN_H)                                /* Linux, BSD, Hurd */
 #   include <dlfcn.h>                        /* dlopen(), dlsym(), dlclose() */
diff -urN vlc.cvs/src/misc/mtime.c vlc/src/misc/mtime.c
--- vlc.cvs/src/misc/mtime.c	Mon May  7 06:42:42 2001
+++ vlc/src/misc/mtime.c	Thu May 31 00:29:10 2001
@@ -33,14 +33,20 @@
 #include "defs.h"
 
 #include <stdio.h>                                              /* sprintf() */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* select() */
+#endif
+
+#if !defined( _MSC_VER )
 #include <sys/time.h>
+#endif
 
 #ifdef HAVE_KERNEL_OS_H
 #include <kernel/OS.h>
 #endif
 
-#ifdef WIN32
+#if defined( WIN32 )
 #include <windows.h>
 #endif
 
@@ -58,11 +64,11 @@
 char *mstrtime( char *psz_buffer, mtime_t date )
 {
     sprintf( psz_buffer, "%02d:%02d:%02d-%03d.%03d",
-             (int) (date / (1000LL * 1000LL * 60LL * 60LL) % 24LL),
-             (int) (date / (1000LL * 1000LL * 60LL) % 60LL),
-             (int) (date / (1000LL * 1000LL) % 60LL),
-             (int) (date / 1000LL % 1000LL),
-             (int) (date % 1000LL) );
+             (int) (date / (I64C(1000) * I64C(1000) * I64C(60) * I64C(60)) % I64C(24)),
+             (int) (date / (I64C(1000) * I64C(1000) * I64C(60)) % I64C(60)),
+             (int) (date / (I64C(1000) * I64C(1000)) % I64C(60)),
+             (int) (date / I64C(1000) % I64C(1000)),
+             (int) (date % I64C(1000)) );
     return( psz_buffer );
 }
 
diff -urN vlc.cvs/src/misc/netutils.c vlc/src/misc/netutils.c
--- vlc.cvs/src/misc/netutils.c	Wed May 30 19:03:12 2001
+++ vlc/src/misc/netutils.c	Thu May 31 00:32:00 2001
@@ -32,10 +32,18 @@
 #include <stdlib.h>                             /* free(), realloc(), atoi() */
 #include <errno.h>                                                /* errno() */
 #include <string.h>                                              /* memset() */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                         /* gethostname() */
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
+
+#if !defined( _MSC_VER )
 #include <sys/time.h>                                        /* gettimeofday */
+#endif
 
-#ifndef WIN32
+#if !defined( WIN32 )
 #include <netdb.h>                                        /* gethostbyname() */
 #include <netinet/in.h>                               /* BSD: struct in_addr */
 #include <sys/socket.h>                              /* BSD: struct sockaddr */
@@ -49,7 +57,7 @@
 #include <sys/ioctl.h>                                            /* ioctl() */
 #endif
 
-#ifdef WIN32                            /* tools to get the MAC adress from  */
+#if defined( WIN32 )                    /* tools to get the MAC adress from  */
 #include <windows.h>                    /* the interface under Windows	     */
 #include <stdio.h>
 #endif
diff -urN vlc.cvs/src/spu_decoder/spu_decoder.c vlc/src/spu_decoder/spu_decoder.c
--- vlc.cvs/src/spu_decoder/spu_decoder.c	Fri May 11 17:10:02 2001
+++ vlc/src/spu_decoder/spu_decoder.c	Thu May 31 00:29:10 2001
@@ -26,7 +26,10 @@
  *****************************************************************************/
 #include "defs.h"
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* getpid() */
+#endif
+
 #ifdef WIN32                   /* getpid() for win32 is located in process.h */
 #include <process.h>
 #endif
diff -urN vlc.cvs/src/video_decoder/video_decoder.c vlc/src/video_decoder/video_decoder.c
--- vlc.cvs/src/video_decoder/video_decoder.c	Wed May 30 19:03:12 2001
+++ vlc/src/video_decoder/video_decoder.c	Thu May 31 00:29:10 2001
@@ -27,7 +27,9 @@
  *****************************************************************************/
 #include "defs.h"
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* getpid() */
+#endif
 
 #include <stdlib.h>                                                /* free() */
 #include <string.h>                                    /* memcpy(), memset() */
diff -urN vlc.cvs/src/video_output/video_text.c vlc/src/video_output/video_text.c
--- vlc.cvs/src/video_output/video_text.c	Sat Apr 28 05:36:26 2001
+++ vlc/src/video_output/video_text.c	Thu May 31 00:29:10 2001
@@ -32,7 +32,12 @@
 #include <stdio.h>                                              /* sprintf() */
 #include <string.h>                                            /* strerror() */
 #include <fcntl.h>                                                 /* open() */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                       /* read(), close() */
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#include <io.h>
+#endif
 
 #ifdef SYS_BEOS
 #   include "beos_specific.h"
@@ -481,7 +486,7 @@
                                                      p_font->i_interspacing);
 
     /* compute where to stop... */
-    i_end = (int) (i_percent * strlen(psz_text) / 100LL);
+    i_end = (int) (i_percent * strlen(psz_text) / I64C(100));
     if(i_end > strlen(psz_text))
         i_end = strlen(psz_text);
     
diff -urN vlc.cvs/src/video_parser/video_parser.c vlc/src/video_parser/video_parser.c
--- vlc.cvs/src/video_parser/video_parser.c	Wed May 30 19:03:14 2001
+++ vlc/src/video_parser/video_parser.c	Thu May 31 00:29:10 2001
@@ -28,7 +28,11 @@
 #include "defs.h"
 
 #include <stdlib.h>                                      /* malloc(), free() */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                              /* getpid() */
+#endif
+
 #include <errno.h>
 #include <string.h>
 



