Merge pull request #2664 from driver1998/build-fixes
Build fixes on Clang
This commit is contained in:
@@ -23,7 +23,9 @@
|
|||||||
#ifndef PLAT_WIN_H
|
#ifndef PLAT_WIN_H
|
||||||
#define PLAT_WIN_H
|
#define PLAT_WIN_H
|
||||||
|
|
||||||
|
#ifndef UNICODE
|
||||||
#define UNICODE
|
#define UNICODE
|
||||||
|
#endif
|
||||||
#define BITMAP WINDOWS_BITMAP
|
#define BITMAP WINDOWS_BITMAP
|
||||||
#if 0
|
#if 0
|
||||||
# ifdef _WIN32_WINNT
|
# ifdef _WIN32_WINNT
|
||||||
|
@@ -329,10 +329,12 @@ net_slirp_thread(void *priv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NET_EVENT_TX:
|
case NET_EVENT_TX:
|
||||||
|
{
|
||||||
int packets = network_tx_popv(slirp->card, slirp->pkt_tx_v, SLIRP_PKT_BATCH);
|
int packets = network_tx_popv(slirp->card, slirp->pkt_tx_v, SLIRP_PKT_BATCH);
|
||||||
for (int i = 0; i < packets; i++) {
|
for (int i = 0; i < packets; i++) {
|
||||||
net_slirp_in(slirp, slirp->pkt_tx_v[i].data, slirp->pkt_tx_v[i].len);
|
net_slirp_in(slirp, slirp->pkt_tx_v[i].data, slirp->pkt_tx_v[i].len);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@@ -205,15 +205,15 @@ void joystick_get_capabilities(raw_joystick_t* rawjoy, plat_joystick_t* joy) {
|
|||||||
|
|
||||||
void joystick_get_device_name(raw_joystick_t* rawjoy, plat_joystick_t* joy, PRID_DEVICE_INFO info) {
|
void joystick_get_device_name(raw_joystick_t* rawjoy, plat_joystick_t* joy, PRID_DEVICE_INFO info) {
|
||||||
UINT size = 0;
|
UINT size = 0;
|
||||||
char *device_name = NULL;
|
WCHAR *device_name = NULL;
|
||||||
WCHAR device_desc_wide[200] = {0};
|
WCHAR device_desc_wide[200] = {0};
|
||||||
|
|
||||||
GetRawInputDeviceInfoA(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size);
|
GetRawInputDeviceInfoW(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size);
|
||||||
device_name = calloc(size, sizeof(char));
|
device_name = calloc(size, sizeof(WCHAR));
|
||||||
if (GetRawInputDeviceInfoA(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size) <= 0)
|
if (GetRawInputDeviceInfoW(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size) <= 0)
|
||||||
fatal("joystick_get_capabilities: Failed to get device name.\n");
|
fatal("joystick_get_capabilities: Failed to get device name.\n");
|
||||||
|
|
||||||
HANDLE hDevObj = CreateFile(device_name, GENERIC_READ | GENERIC_WRITE,
|
HANDLE hDevObj = CreateFileW(device_name, GENERIC_READ | GENERIC_WRITE,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
||||||
if (hDevObj) {
|
if (hDevObj) {
|
||||||
HidD_GetProductString(hDevObj, device_desc_wide, sizeof(WCHAR) * 200);
|
HidD_GetProductString(hDevObj, device_desc_wide, sizeof(WCHAR) * 200);
|
||||||
|
@@ -220,15 +220,15 @@ void
|
|||||||
joystick_get_device_name(raw_joystick_t *rawjoy, plat_joystick_t *joy, PRID_DEVICE_INFO info)
|
joystick_get_device_name(raw_joystick_t *rawjoy, plat_joystick_t *joy, PRID_DEVICE_INFO info)
|
||||||
{
|
{
|
||||||
UINT size = 0;
|
UINT size = 0;
|
||||||
char *device_name = NULL;
|
WCHAR *device_name = NULL;
|
||||||
WCHAR device_desc_wide[200] = { 0 };
|
WCHAR device_desc_wide[200] = { 0 };
|
||||||
|
|
||||||
GetRawInputDeviceInfoA(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size);
|
GetRawInputDeviceInfoW(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size);
|
||||||
device_name = calloc(size, sizeof(char));
|
device_name = calloc(size, sizeof(WCHAR));
|
||||||
if (GetRawInputDeviceInfoA(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size) <= 0)
|
if (GetRawInputDeviceInfoW(rawjoy->hdevice, RIDI_DEVICENAME, device_name, &size) <= 0)
|
||||||
fatal("joystick_get_capabilities: Failed to get device name.\n");
|
fatal("joystick_get_capabilities: Failed to get device name.\n");
|
||||||
|
|
||||||
HANDLE hDevObj = CreateFile(device_name, GENERIC_READ | GENERIC_WRITE,
|
HANDLE hDevObj = CreateFileW(device_name, GENERIC_READ | GENERIC_WRITE,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
||||||
if (hDevObj) {
|
if (hDevObj) {
|
||||||
HidD_GetProductString(hDevObj, device_desc_wide, sizeof(WCHAR) * 200);
|
HidD_GetProductString(hDevObj, device_desc_wide, sizeof(WCHAR) * 200);
|
||||||
|
Reference in New Issue
Block a user