dlls/ntdll/cdrom.c breakage

Gerald Pfeifer gerald at pfeifer.com
Wed Jun 29 16:37:42 CDT 2005


On Wed, 29 Jun 2005, Dmitry Timoshkov wrote:
>> breaks on FreeBSD
>> 
>>   cdrom.c: In function `CDROM_ScsiPassThroughDirect':
>>   cdrom.c:1419: error: invalid application of `sizeof' to an incomplete type
>>   cdrom.c:1411: warning: unused variable `io'
>>   cdrom.c: In function `CDROM_ScsiPassThrough':
>>   cdrom.c:1534: error: invalid application of `sizeof' to an incomplete type
>>   cdrom.c:1526: warning: unused variable `io'
>> which does not have struct request_sense, but does have struct 
>> scsi_request_sense in /usr/include/cam/scsi/scsi_all.h.
> Attached patch is a workaround for the problem. A correct approach is to 
> add a test for presence of the 'struct request_sense' to configure and 
> add appropriate #ifdef's in the code.
> 
> Changelog:
>     Dmitry Timoshkov <dmitry at codeweavers.com>
>     A workaround for missing struct request_sense on FreeBSD.

Thanks for the quick response, Dmitry!  Unfortunately, the patch that
Alexandre now committed does not solve the problem for me, and my 
autoconf foo is a bit rusty:

  cdrom.c: In function `CDROM_ScsiPassThroughDirect':
  drom.c:1423: error: invalid application of `sizeof' to an incomplete type
  cdrom.c: In function `CDROM_ScsiPassThrough':
  cdrom.c:1543: error: invalid application of `sizeof' to an incomplete type


Alexandre, please find below another patch which does not fix this either, 
but gets rid of some unused variable warnings.

Gerald

ChangeLog:
Avoid unused variable warnings in CDROM_ScsiPassThroughDir() and
CDROM_ScsiPassThrough().

Index: cdrom.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/cdrom.c,v
retrieving revision 1.59
diff -u -3 -p -r1.59 cdrom.c
--- cdrom.c	29 Jun 2005 19:18:54 -0000	1.59
+++ cdrom.c	29 Jun 2005 21:36:26 -0000
@@ -1405,10 +1405,11 @@ static NTSTATUS CDROM_ScsiPassThroughDir
     int ret = STATUS_NOT_SUPPORTED;
 #ifdef HAVE_SG_IO_HDR_T_INTERFACE_ID
     sg_io_hdr_t cmd;
+    int io;
 #elif defined HAVE_SCSIREQ_T_CMD
     scsireq_t cmd;
-#endif
     int io;
+#endif
 
     if (pPacket->Length < sizeof(SCSI_PASS_THROUGH_DIRECT))
         return STATUS_BUFFER_TOO_SMALL;
@@ -1524,10 +1525,11 @@ static NTSTATUS CDROM_ScsiPassThrough(in
     int ret = STATUS_NOT_SUPPORTED;
 #ifdef HAVE_SG_IO_HDR_T_INTERFACE_ID
     sg_io_hdr_t cmd;
+    int io;
 #elif defined HAVE_SCSIREQ_T_CMD
     scsireq_t cmd;
-#endif
     int io;
+#endif
 
     if (pPacket->Length < sizeof(SCSI_PASS_THROUGH))
         return STATUS_BUFFER_TOO_SMALL;



More information about the wine-devel mailing list