changeset 185:36777e6346c5 src

First update for Win32/msvc support
author tchamp
date Tue, 29 Apr 2003 19:31:37 +0000
parents c2e7199becdb
children fb1b6c1c3d2c
files bswap.h decoder.c dvd_input.c dvd_reader.c dvd_reader.h
diffstat 5 files changed, 25 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/bswap.h	Tue Apr 29 15:25:20 2003 +0000
+++ b/bswap.h	Tue Apr 29 19:31:37 2003 +0000
@@ -65,7 +65,7 @@
  * functionality! 
  */
 
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(_MSC_VER)
+#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32)
 #define B2N_16(x) \
  x = ((((x) & 0xff00) >> 8) | \
       (((x) & 0x00ff) << 8))
--- a/decoder.c	Tue Apr 29 15:25:20 2003 +0000
+++ b/decoder.c	Tue Apr 29 19:31:37 2003 +0000
@@ -32,6 +32,7 @@
 #include <string.h>  /* For memset */
 #include "ifo_types.h" /* vm_cmd_t */
 #include <assert.h>
+
 #include "dvdnav_internal.h"
 
 uint32_t vm_getbits(command_t *command, int start, int count) {
--- a/dvd_input.c	Tue Apr 29 15:25:20 2003 +0000
+++ b/dvd_input.c	Tue Apr 29 19:31:37 2003 +0000
@@ -24,9 +24,18 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include <dlfcn.h>
+
 #include "dvd_reader.h"
 #include "dvd_input.h"
 
+
+#ifndef _MSC_VER
+#define LIBDVDCSS_NAME = "libdvdcss.so.2"
+#else
+#define LIBDVDCSS_NAME = "libdvdcss.dll"
+#endif
+
 /* The function pointers that is the exported interface of this file. */
 dvd_input_t (*dvdinput_open)  (const char *);
 int         (*dvdinput_close) (dvd_input_t);
@@ -45,8 +54,10 @@
 #define DVDcss_read    dvdcss_read
 #define DVDcss_error   dvdcss_error
 #else
+
 /* dlopening libdvdcss */
 #include <dlfcn.h>
+
 typedef struct dvdcss_s *dvdcss_handle;
 static dvdcss_handle (*DVDcss_open)  (const char *);
 static int           (*DVDcss_close) (dvdcss_handle);
@@ -274,8 +285,13 @@
 
 #else
   /* dlopening libdvdcss */
+
+#ifndef _MSC_VER
   dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
-  
+#else
+  dvdcss_library = dlopen("libdvdcss.dll", RTLD_LAZY);
+#endif
+
   if(dvdcss_library != NULL) {
 #if defined(__OpenBSD__) && !defined(__ELF__)
 #define U_S "_"
--- a/dvd_reader.c	Tue Apr 29 15:25:20 2003 +0000
+++ b/dvd_reader.c	Tue Apr 29 19:31:37 2003 +0000
@@ -314,15 +314,10 @@
 
 #ifdef _MSC_VER
 
-#ifdef WIN32_CSS
     /* Try to open libdvdcss or fall back to standard functions */
     have_css = dvdinput_setup();
 
     return DVDOpenImageFile( path, have_css );
-#else
-    /* Under Win32, we only try to open image files */
-    return DVDOpenImageFile( path, DVDInputSetup() );
-#endif
 
 #else
 
--- a/dvd_reader.h	Tue Apr 29 15:25:20 2003 +0000
+++ b/dvd_reader.h	Tue Apr 29 19:31:37 2003 +0000
@@ -21,9 +21,12 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#if defined(_MSC_VER)
-typedef long ssize_t;
-#endif /* _MSC_VER */
+#ifdef _MSC_VER
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#endif
 
 #include <sys/types.h>