diff --git a/desmume/src/driver.h b/desmume/src/driver.h index 541074611..ca4cf3422 100644 --- a/desmume/src/driver.h +++ b/desmume/src/driver.h @@ -46,7 +46,6 @@ public: ~BaseDriver(); #ifdef EXPERIMENTAL_WIFI_COMM -#ifdef _WINDOWS virtual bool WIFI_SocketsAvailable() { return true; } virtual bool WIFI_PCapAvailable() { return false; } @@ -59,33 +58,7 @@ public: virtual int PCAP_setnonblock(pcap_t* dev, int nonblock, char* errbuf) { return -1; } virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) { return -1; } virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) { return -1; } -#else - virtual bool WIFI_SocketsAvailable() { return true; } - virtual bool WIFI_PCapAvailable() { return true; } - virtual bool WIFI_WFCWarning() { return false; } - - virtual int PCAP_findalldevs(pcap_if_t** alldevs, char* errbuf) { - return pcap_findalldevs(alldevs, errbuf); } - - virtual void PCAP_freealldevs(pcap_if_t* alldevs) { - pcap_freealldevs(alldevs); } - - virtual pcap_t* PCAP_open(const char* source, int snaplen, int flags, int readtimeout, char* errbuf) { - return pcap_open_live(source, snaplen, flags, readtimeout, errbuf); } - - virtual void PCAP_close(pcap_t* dev) { - pcap_close(dev); } - - virtual int PCAP_setnonblock(pcap_t* dev, int nonblock, char* errbuf) { - return pcap_setnonblock(dev, nonblock, errbuf); } - - virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) { - return pcap_sendpacket(dev, data, len); } - - virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) { - return pcap_dispatch(dev, num, callback, userdata); } -#endif /* WINDOWS */ -#endif /* EXPERIMENTAL_WIFI_COMM */ +#endif virtual void AVI_SoundUpdate(void* soundData, int soundLen) {} virtual bool AVI_IsRecording() { return FALSE; } @@ -122,4 +95,36 @@ public: }; extern BaseDriver* driver; +#ifndef _WINDOWS +class UnixDriver : public BaseDriver +{ +#ifdef EXPERIMENTAL_WIFI_COMM + virtual bool WIFI_SocketsAvailable() { return true; } + virtual bool WIFI_PCapAvailable() { return true; } + virtual bool WIFI_WFCWarning() { return true; } + + virtual int PCAP_findalldevs(pcap_if_t** alldevs, char* errbuf) { + return pcap_findalldevs(alldevs, errbuf); } + + virtual void PCAP_freealldevs(pcap_if_t* alldevs) { + pcap_freealldevs(alldevs); } + + virtual pcap_t* PCAP_open(const char* source, int snaplen, int flags, int readtimeout, char* errbuf) { + return pcap_open_live(source, snaplen, flags, readtimeout, errbuf); } + + virtual void PCAP_close(pcap_t* dev) { + pcap_close(dev); } + + virtual int PCAP_setnonblock(pcap_t* dev, int nonblock, char* errbuf) { + return pcap_setnonblock(dev, nonblock, errbuf); } + + virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) { + return pcap_sendpacket(dev, data, len); } + + virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) { + return pcap_dispatch(dev, num, callback, userdata); } +#endif +}; +#endif + #endif //_DRIVER_H_ diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 89bd1edf0..d3e14ff7d 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -1693,7 +1693,7 @@ static inline void _updateDTools() /////////////////////////////// MAIN EMULATOR LOOP /////////////////////////////// -class GtkDriver : public BaseDriver +class GtkDriver : public UnixDriver { public: virtual void EMU_DebugIdleUpdate()