Fixing compiler complaints with MinGW and adding support for RAW disk access when compiling with MinGW on windows.

This commit is contained in:
Mark Pizzolato 2012-12-16 20:18:54 -08:00
parent cd0ef35bbf
commit 18b6ab89d0

View file

@ -1285,8 +1285,12 @@ if ((dwStatus >= ERROR_INVALID_STARTING_CODESEG) && (dwStatus <= ERROR_INFLOOP_I
}
errno = EINVAL;
}
#if defined(__GNUC__)
#include <ddk/ntddstor.h>
#include <ddk/ntdddisk.h>
#else
#include <winioctl.h>
#if !defined(__GNUC__)
#endif
struct _device_type {
int32 Type;
char *desc;
@ -1377,7 +1381,6 @@ for (i=0; DeviceTypes[i].desc; i++)
return DeviceTypes[i].desc;
return "Unknown";
}
#endif
static t_stat sim_os_disk_implemented_raw (void)
{
@ -1528,7 +1531,6 @@ return TRUE;
static t_stat sim_os_disk_info_raw (FILE *Disk, uint32 *sector_size, uint32 *removable)
{
DWORD IoctlReturnSize;
#if !defined(__GNUC__)
STORAGE_DEVICE_NUMBER Device;
ZeroMemory (&Device, sizeof (Device));
@ -1541,7 +1543,6 @@ if (DeviceIoControl((HANDLE)Disk, /* handle to volume */
(LPDWORD) &IoctlReturnSize, /* number of bytes returned */
(LPOVERLAPPED) NULL)) /* OVERLAPPED structure */
printf ("Device OK - Type: %s, Number: %d\n", _device_type_name (Device.DeviceType), (int)Device.DeviceNumber);
#endif
if (sector_size)
*sector_size = 512;