shithub: libdvdcss

Download patch

ref: a9bf4c166d6af89a7310a61ae082944f9d960b22
parent: 0938da8a3ebb4b9e1e3c2383a4821fa8eb524a87
author: Diego Biurrun <diego@biurrun.de>
date: Wed Feb 13 09:43:51 EST 2013

build: Drop unnecessary local SYS_OS2 config.h #define

__OS2__ is always available and can be used instead.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>

--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,6 @@
     ;;
   xos2*)
     LDFLAGS="-Zbin-files"
-    AC_DEFINE(SYS_OS2, 1, Have a OS/2 system.)
     ;;
   x*msvc*)
     SYS_MSVC=1
--- a/src/device.c
+++ b/src/device.c
@@ -65,7 +65,7 @@
 #   include <IOKit/storage/IODVDMedia.h>
 #endif
 
-#ifdef SYS_OS2
+#ifdef __OS2__
 #   define INCL_DOS
 #   define INCL_DOSDEVIOCTL
 #   include <os2.h>
@@ -99,7 +99,7 @@
 static int win_readv  ( dvdcss_t, struct iovec *, int );
 
 static int aspi_read_internal  ( int, void *, int );
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
 static int os2_open ( dvdcss_t, char const * );
 /* just use macros for libc */
 #   define os2_seek     libc_seek
@@ -124,7 +124,7 @@
     {
         return 1;
     }
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     ULONG ulMode;
 
     if( DosQueryFHState( dvdcss->i_fd, &ulMode ) != 0 )
@@ -181,7 +181,7 @@
     kern_return_t kern_result;
     io_iterator_t media_iterator;
     CFMutableDictionaryRef classes_to_match;
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
 #pragma pack( 1 )
     struct
     {
@@ -316,7 +316,7 @@
     }
 
     IOObjectRelease( media_iterator );
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     for( i = 0; i < 26; i++ )
     {
         param.bCmdInfo = 0;
@@ -394,7 +394,7 @@
         return aspi_open( dvdcss, psz_device );
     }
     else
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     /* If device is "X:" or "X:\", we are not actually opening a file. */
     if( psz_device[0] && psz_device[1] == ':' &&
         ( !psz_device[2] || ( psz_device[2] == '\\' && !psz_device[3] ) ) )
@@ -416,7 +416,7 @@
     }
 }
 
-#if !defined(WIN32) && !defined(SYS_OS2)
+#if !defined(WIN32) && !defined(__OS2__)
 int _dvdcss_raw_open ( dvdcss_t dvdcss, char const *psz_device )
 {
     dvdcss->i_raw_fd = open( psz_device, 0 );
@@ -469,7 +469,7 @@
 #else
     close( dvdcss->i_fd );
 
-#ifndef SYS_OS2
+#ifndef __OS2__
     if( dvdcss->i_raw_fd >= 0 )
     {
         close( dvdcss->i_raw_fd );
@@ -488,7 +488,7 @@
  *****************************************************************************/
 static int libc_open ( dvdcss_t dvdcss, char const *psz_device )
 {
-#if !defined( WIN32 ) && !defined( SYS_OS2 )
+#if !defined( WIN32 ) && !defined( __OS2__ )
     dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, 0 );
 #else
     dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, O_BINARY );
@@ -664,7 +664,7 @@
 }
 #endif
 
-#ifdef SYS_OS2
+#ifdef __OS2__
 static int os2_open ( dvdcss_t dvdcss, char const *psz_device )
 {
     char  psz_dvd[] = "X:";
--- a/src/device.h
+++ b/src/device.h
@@ -57,7 +57,7 @@
 /*****************************************************************************
  * Device reading prototypes, raw-device specific
  *****************************************************************************/
-#if !defined(WIN32) && !defined(SYS_OS2)
+#if !defined(WIN32) && !defined(__OS2__)
 int _dvdcss_raw_open     ( dvdcss_t, char const * );
 #endif
 
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -41,7 +41,7 @@
 #if defined( WIN32 )
 #   include <windows.h>
 #   include <winioctl.h>
-#elif defined ( SYS_OS2 )
+#elif defined ( __OS2__ )
 #   define INCL_DOSFILEMGR
 #   define INCL_DOSDEVICES
 #   define INCL_DOSDEVIOCTL
@@ -135,7 +135,7 @@
 /*****************************************************************************
  * Local prototypes, OS2 specific
  *****************************************************************************/
-#if defined( SYS_OS2 )
+#if defined( __OS2__ )
 static void OS2InitSDC( struct OS2_ExecSCSICmd *, int );
 #endif
 
@@ -257,7 +257,7 @@
 
     *pi_copyright = p_buffer[4];
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_READ_DVD_STRUCTURE, 8 );
 
     sdc.command[ 6 ] = i_layer;
@@ -425,7 +425,7 @@
 
     memcpy( p_key, p_buffer + 4, DVD_DISCKEY_SIZE );
 
-#elif defined ( SYS_OS2 )
+#elif defined ( __OS2__ )
     INIT_SSC( GPCMD_READ_DVD_STRUCTURE, DVD_DISCKEY_SIZE + 4 );
 
     sdc.command[ 7 ]  = DVD_STRUCT_DISCKEY;
@@ -591,7 +591,7 @@
 
     memcpy( p_key, p_buffer + 5, DVD_KEY_SIZE );
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_REPORT_KEY, 12 );
 
     sdc.command[ 2 ] = ( i_pos >> 24 ) & 0xff;
@@ -719,7 +719,7 @@
 
     *pi_agid = p_buffer[ 7 ] >> 6;
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_REPORT_KEY, 8 );
 
     sdc.command[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6);
@@ -853,7 +853,7 @@
 
     memcpy( p_challenge, p_buffer + 4, DVD_CHALLENGE_SIZE );
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_REPORT_KEY, 16 );
 
     sdc.command[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6);
@@ -986,7 +986,7 @@
 
     *pi_asf = p_buffer[ 7 ] & 1;
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_REPORT_KEY, 8 );
 
     sdc.command[ 10 ] = DVD_REPORT_ASF;
@@ -1115,7 +1115,7 @@
 
     memcpy( p_key, p_buffer + 4, DVD_KEY_SIZE );
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_REPORT_KEY, 12 );
 
     sdc.command[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6);
@@ -1225,7 +1225,7 @@
 
     i_ret = devctl(i_fd, DCMD_CAM_PASS_THRU, p_cpt, structSize, NULL);
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_REPORT_KEY, 1 );
 
     sdc.data_length = 0;
@@ -1362,7 +1362,7 @@
 
     i_ret = devctl(i_fd, DCMD_CAM_PASS_THRU, p_cpt, structSize, NULL);
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_SEND_KEY, 16 );
 
     sdc.command[ 10 ] = DVD_SEND_CHALLENGE | (*pi_agid << 6);
@@ -1499,7 +1499,7 @@
 
     i_ret = devctl(i_fd, DCMD_CAM_PASS_THRU, p_cpt, structSize, NULL);
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_SEND_KEY, 12 );
 
     sdc.command[ 10 ] = DVD_SEND_KEY2 | (*pi_agid << 6);
@@ -1653,7 +1653,7 @@
     *p_mask = p_buffer[ 5 ];
     *p_scheme = p_buffer[ 6 ];
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_REPORT_KEY, 8 );
 
     sdc.command[ 10 ] = DVD_REPORT_RPC;
@@ -1781,7 +1781,7 @@
 
     i_ret = devctl(i_fd, DCMD_CAM_PASS_THRU, p_cpt, structSize, NULL);
 
-#elif defined( SYS_OS2 )
+#elif defined( __OS2__ )
     INIT_SSC( GPCMD_SEND_KEY, 8 );
 
     sdc.command[ 10 ] = DVD_SEND_RPC;
@@ -2093,7 +2093,7 @@
 }
 #endif
 
-#if defined( SYS_OS2 )
+#if defined( __OS2__ )
 /*****************************************************************************
  * OS2InitSDC: initialize a SDC structure for the Execute SCSI-command
  *****************************************************************************
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -144,7 +144,7 @@
 /*****************************************************************************
  * Common macro, OS2 specific
  *****************************************************************************/
-#if defined( SYS_OS2 )
+#if defined( __OS2__ )
 #define INIT_SSC( TYPE, SIZE ) \
     struct OS2_ExecSCSICmd sdc; \
     uint8_t p_buffer[ (SIZE)+1 ]; \
@@ -406,7 +406,7 @@
 /*****************************************************************************
  * OS2 ioctl specific
  *****************************************************************************/
-#if defined( SYS_OS2 )
+#if defined( __OS2__ )
 
 #define CDROMDISK_EXECMD      0x7A
 
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -170,7 +170,7 @@
     char *psz_method = getenv( "DVDCSS_METHOD" );
     char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
     char *psz_cache = getenv( "DVDCSS_CACHE" );
-#if !defined(WIN32) && !defined(SYS_OS2)
+#if !defined(WIN32) && !defined(__OS2__)
     char *psz_raw_device = getenv( "DVDCSS_RAW_DEVICE" );
 #endif
 
@@ -188,7 +188,7 @@
     /*
      *  Initialize structure with default values
      */
-#if !defined(WIN32) && !defined(SYS_OS2)
+#if !defined(WIN32) && !defined(__OS2__)
     dvdcss->i_raw_fd = -1;
 #endif
     dvdcss->p_titles = NULL;
@@ -312,7 +312,7 @@
         {
             int home_pos = 0;
 
-#ifdef SYS_OS2
+#ifdef __OS2__
             if( *psz_home == '/' || *psz_home == '\\')
             {
                 char *psz_unixroot = getenv("UNIXROOT");
@@ -552,7 +552,7 @@
     }
     nocache:
 
-#if !defined(WIN32) && !defined(SYS_OS2)
+#if !defined(WIN32) && !defined(__OS2__)
     if( psz_raw_device != NULL )
     {
         _dvdcss_raw_open( dvdcss, psz_raw_device );
--- a/src/libdvdcss.h
+++ b/src/libdvdcss.h
@@ -68,7 +68,7 @@
     int    i_readv_buf_size;
 #endif
 
-#if !defined(WIN32) && !defined(SYS_OS2)
+#if !defined(WIN32) && !defined(__OS2__)
     int    i_raw_fd;
 #endif
 };