Skip to content

Commit

Permalink
Fix Linux build, second attempt.
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioginer committed Apr 2, 2024
1 parent fa750b6 commit e3811bb
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/osd/modules/input/input_mister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// copyright-holders:Brad Hughes, Antonio Giner, Sergi Clara
//============================================================
//
// input_mister.cpp - Default unimplemented input modules
// input_mister.cpp - nogpu input module
//
//============================================================

Expand Down Expand Up @@ -217,13 +217,13 @@ class joystick_input_mister : public osd_module, public input_module
joystick1("MiSTer", "joy1", *this, 1),
joystick2("MiSTer", "joy2", *this, 2) {};

~joystick_input_mister() { close(); };
~joystick_input_mister() { deinit(); };
virtual int init(osd_interface &osd, const osd_options &options) override;
virtual void input_init(running_machine &machine) override;
virtual void poll_if_necessary(bool relative_reset) override;

private:
void close();
void deinit();

bool m_initialized = false;
int m_sockfd = -1; //INVALID_SOCKET;
Expand All @@ -240,19 +240,17 @@ class joystick_input_mister : public osd_module, public input_module

int joystick_input_mister::init(osd_interface &osd, const osd_options &options)
{
int result;

if (m_initialized)
{
close();
deinit();
inputs = {0};
m_initialized = false;
}

#ifdef _WIN32
osd_printf_verbose("nogpu_input: Initializing Winsock...");
WSADATA wsa;
result = WSAStartup(MAKEWORD(2, 2), &wsa);
int result = WSAStartup(MAKEWORD(2, 2), &wsa);
if (result != NO_ERROR)
{
osd_printf_verbose("Failed. Error code : %d", WSAGetLastError());
Expand Down Expand Up @@ -309,10 +307,10 @@ int joystick_input_mister::init(osd_interface &osd, const osd_options &options)
}

//============================================================
// joystick_input_mister::close
// joystick_input_mister::deinit
//============================================================

void joystick_input_mister::close()
void joystick_input_mister::deinit()
{
osd_printf_verbose("nogpu_input: closing input socket.\n");
#ifdef WIN32
Expand Down

0 comments on commit e3811bb

Please sign in to comment.