Skip to content

Commit

Permalink
Added stub for OSX SysMessage.
Browse files Browse the repository at this point in the history
  • Loading branch information
juhalaukkanen committed Jan 20, 2015
1 parent a41308e commit d52e862
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions common/include/PS2Eext.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@
#include <commctrl.h>

#define EXPORT_C_(type) extern "C" type CALLBACK
#else

#elseif defined(__GTK__) || defined(__WXGTK__)

#include <gtk/gtk.h>
#include <cstring>

#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type

#else

#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type

#endif

//#include "PS2Edefs.h"
Expand Down Expand Up @@ -161,7 +168,7 @@ struct PluginConf
}
};

#ifdef __linux__
#if defined(__WXGTK__) || defined(__GTK__)

static void SysMessage(const char *fmt, ...)
{
Expand Down Expand Up @@ -221,6 +228,36 @@ static void __forceinline PluginNullAbout(const char *aboutText)

#define ENTRY_POINT /* We don't need no stinkin' entry point! */


#elif defined(__WXMAC__) || defined(__APPLE__)

static void SysMessage(const char *fmt, ...)
{
va_list list;
char msg[512];

va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);

if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;

// TODO OSX can we use WX MessageBox here or should Cocoa MessageBox used?
}

static void __forceinline PluginNullConfigure(std::string desc, int &log)
{
SysMessage("This space intentionally left blank.");
}

static void __forceinline PluginNullAbout(const char *aboutText)
{
SysMessage(aboutText);
}

#define ENTRY_POINT /* We don't need no stinkin' entry point! */ // TODO OSX WTF is this anyway?


#else

#define usleep(x) Sleep(x / 1000)
Expand Down

0 comments on commit d52e862

Please sign in to comment.