[DVDnav-discuss] r1156 - in trunk/libdvdnav: configure.ac src/vm/vm.c

diego subversion at mplayerhq.hu
Fri Oct 10 00:20:37 CEST 2008


Author: diego
Date: Fri Oct 10 00:20:36 2008
New Revision: 1156

Log:
OS/2 support by KO Myung-Hun, komh chollian net


Modified:
   trunk/libdvdnav/configure.ac
   trunk/libdvdnav/src/vm/vm.c

Modified: trunk/libdvdnav/configure.ac
==============================================================================
--- trunk/libdvdnav/configure.ac	(original)
+++ trunk/libdvdnav/configure.ac	Fri Oct 10 00:20:36 2008
@@ -165,6 +165,9 @@ case $host in
   *cygwin*)
     LDFLAGS="-no-undefined $LDFLAGS"
     ;;
+  *os2*)
+    LDFLAGS="-no-undefined -Zbin-files $LDFLAGS"
+    ;;
   *)
     AC_CHECK_LIB(c, dlopen,
 	         DYNAMIC_LD_LIBS="",

Modified: trunk/libdvdnav/src/vm/vm.c
==============================================================================
--- trunk/libdvdnav/src/vm/vm.c	(original)
+++ trunk/libdvdnav/src/vm/vm.c	Fri Oct 10 00:20:36 2008
@@ -52,6 +52,11 @@
 #include <io.h>   /* read() */
 #endif /* _MSC_VER */
 
+#ifdef __OS2__
+#define INCL_DOS
+#include <os2.h>
+#endif
+
 /*
 #define STRICT
 */
@@ -131,6 +136,27 @@ static void vm_print_current_domain_stat
 }
 #endif
 
+#ifdef __OS2__
+#define open os2_open
+
+static int os2_open(const char *name, int oflag)
+{
+    HFILE hfile;
+    ULONG ulAction;
+    ULONG rc;
+
+    rc = DosOpen( name, &hfile, &ulAction, 0, FILE_NORMAL,
+                  OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
+                  OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
+                  NULL );
+
+    if( rc )
+        return -1;
+
+    return ( int )hfile;
+}
+#endif
+
 static void dvd_read_name(char *name, const char *device) {
     /* Because we are compiling with _FILE_OFFSET_BITS=64
      * all off_t are 64bit.



More information about the DVDnav-discuss mailing list