Gerald Pfeifer gerald@pfeifer.com writes:
ChangeLog: Take into account that FreeBSD and others have MTSETBSIZ instead of MTSETBLK and that struct mt_blksiz is laid out somewhat differently.
Please add configure checks instead of #ifdef __FreeBSD__.
On Sat, 4 Feb 2006, Alexandre Julliard wrote:
ChangeLog: Take into account that FreeBSD and others have MTSETBSIZ instead of MTSETBLK and that struct mt_blksiz is laid out somewhat differently.
Please add configure checks instead of #ifdef __FreeBSD__.
I considered that, but am not really happy about it, because configure checks won't really be able to check the semantics of specific members of the various structs, and see whether it meets what we think it does. Checking for __FreeBSD__, on the other hand, solves this.
Regardless of this discussion, would you mind applying the following part of my original patch?
Gerald
ChangeLog: Take into account that FreeBSD and others have MTSETBSIZ instead of MTSETBLK.
Index: tape.c =================================================================== RCS file: /home/wine/wine/dlls/ntdll/tape.c,v retrieving revision 1.3 diff -u -3 -p -r1.3 tape.c --- tape.c 31 Jan 2006 12:08:47 -0000 1.3 +++ tape.c 3 Feb 2006 17:30:28 -0000 @@ -34,6 +34,10 @@ #if !defined(MTCOMPRESSION) && defined(MTCOMP) #define MTCOMPRESSION MTCOMP #endif +/* FreeBSD, for example, has MTSETBSIZ instead of MTSETBLK. */ +#if !defined(MTSETBLK) && defined(MTSETBSIZ) +#define MTSETBLK MTSETBSIZ +#endif
#define NONAMELESSUNION #define NONAMELESSSTRUCT
On Sat, 4 Feb 2006, Alexandre Julliard wrote:
Please add configure checks instead of #ifdef __FreeBSD__.
Like so?
Tested on SUSE Linux 10.0 and FreeBSD 4.10.
Gerald
ChangeLog: Use struct mtget.mt_blksiz on systems featuring this. Work around using struct mtget.mt_gstat on systems lacking this.
Index: configure.ac =================================================================== RCS file: /home/wine/wine/configure.ac,v retrieving revision 1.425 diff -u -p -r1.425 configure.ac --- configure.ac 26 Jan 2006 12:47:07 -0000 1.425 +++ configure.ac 4 Feb 2006 23:05:54 -0000 @@ -1427,6 +1427,16 @@ AC_CHECK_MEMBERS([scsireq_t.cmd, sg_io_h dnl Check for siginfo_t members AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])
+dnl Check for struct mtget members +AC_CHECK_MEMBERS([struct mtget.mt_blksiz],,, +[#ifdef HAVE_SYS_MTIO_H +#include <sys/mtio.h> +#endif]) +AC_CHECK_MEMBERS([struct mtget.mt_gstat],,, +[#ifdef HAVE_SYS_MTIO_H +#include <sys/mtio.h> +#endif]) + dnl Check for struct option AC_CHECK_MEMBERS([struct option.name],,, [#ifdef HAVE_GETOPT_H Index: dlls/ntdll/tape.c =================================================================== RCS file: /home/wine/wine/dlls/ntdll/tape.c,v retrieving revision 1.3 diff -u -p -r1.3 tape.c --- dlls/ntdll/tape.c 31 Jan 2006 12:08:47 -0000 1.3 +++ dlls/ntdll/tape.c 4 Feb 2006 23:05:54 -0000 @@ -177,7 +177,11 @@ static NTSTATUS TAPE_GetDriveParams( int data->Compression = FALSE; data->DataPadding = FALSE; data->ReportSetmarks = FALSE; +#ifdef HAVE_STRUCT_MTGET_MT_BLKSIZ + data->DefaultBlockSize = get.mt_blksiz; +#else data->DefaultBlockSize = get.mt_dsreg & MT_ST_BLKSIZE_MASK; +#endif data->MaximumBlockSize = data->DefaultBlockSize; data->MinimumBlockSize = data->DefaultBlockSize; data->MaximumPartitionCount = 1; @@ -208,9 +212,17 @@ static NTSTATUS TAPE_GetMediaParams( int
data->Capacity.u.LowPart = 1024 * 1024 * 1024; data->Remaining.u.LowPart = 1024 * 1024 * 1024; +#ifdef HAVE_STRUCT_MTGET_MT_BLKSIZ + data->BlockSize = get.mt_blksiz; +#else data->BlockSize = get.mt_dsreg & MT_ST_BLKSIZE_MASK; +#endif data->PartitionCount = 1; +#ifdef HAVE_STRUCT_MTGET_GSTAT data->WriteProtected = GMT_WR_PROT(get.mt_gstat); +#else + data->WriteProtected = 0; +#endif
return status; #else