Add a configure check for struct request_sense. Use this in

CDROM_ScsiPassThroughDir() and CDROM_ScsiPassThrough() to unbreak the
build on FreeBSD.
This commit is contained in:
Gerald Pfeifer 2005-07-10 17:42:46 +00:00 committed by Alexandre Julliard
parent 738c770dd5
commit b8b15f3e6e
4 changed files with 77 additions and 6 deletions

65
configure vendored
View File

@ -17285,6 +17285,71 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
fi
echo "$as_me:$LINENO: checking for request_sense" >&5
echo $ECHO_N "checking for request_sense... $ECHO_C" >&6
if test "${ac_cv_type_request_sense+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <linux/cdrom.h>
int
main ()
{
if ((request_sense *) 0)
return 0;
if (sizeof (request_sense))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_type_request_sense=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_request_sense=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_request_sense" >&5
echo "${ECHO_T}$ac_cv_type_request_sense" >&6
if test $ac_cv_type_request_sense = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_REQUEST_SENSE 1
_ACEOF
fi

View File

@ -1246,6 +1246,7 @@ AC_C_CONST
AC_C_INLINE
AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t])
AC_CHECK_TYPES([sigset_t],,,[#include <signal.h>])
AC_CHECK_TYPES([request_sense],,,[#include <linux/cdrom.h>])
AC_CACHE_CHECK([whether linux/input.h is for real],
wine_cv_linux_input_h,

View File

@ -1427,10 +1427,11 @@ static NTSTATUS CDROM_ScsiPassThroughDirect(int fd, PSCSI_PASS_THROUGH_DIRECT pP
#ifdef SENSEBUFLEN
if (pPacket->SenseInfoLength > SENSEBUFLEN)
#else
if (pPacket->SenseInfoLength > sizeof(struct request_sense))
#endif
return STATUS_INVALID_PARAMETER;
#elif defined HAVE_REQUEST_SENSE
if (pPacket->SenseInfoLength > sizeof(struct request_sense))
return STATUS_INVALID_PARAMETER;
#endif
if (pPacket->DataTransferLength > 0 && !pPacket->DataBuffer)
return STATUS_INVALID_PARAMETER;
@ -1547,10 +1548,11 @@ static NTSTATUS CDROM_ScsiPassThrough(int fd, PSCSI_PASS_THROUGH pPacket)
#ifdef SENSEBUFLEN
if (pPacket->SenseInfoLength > SENSEBUFLEN)
#else
if (pPacket->SenseInfoLength > sizeof(struct request_sense))
#endif
return STATUS_INVALID_PARAMETER;
#elif defined HAVE_REQUEST_SENSE
if (pPacket->SenseInfoLength > sizeof(struct request_sense))
return STATUS_INVALID_PARAMETER;
#endif
if (pPacket->DataTransferLength > 0 && pPacket->DataBufferOffset < sizeof(SCSI_PASS_THROUGH))
return STATUS_INVALID_PARAMETER;

View File

@ -482,6 +482,9 @@
/* Define to 1 if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define to 1 if the system has the type `request_sense'. */
#undef HAVE_REQUEST_SENSE
/* Define to 1 if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H