$OpenBSD: patch-src_Main_cpp,v 1.3 2018/04/09 05:25:45 bentley Exp $
Index: src/Main.cpp
--- src/Main.cpp.orig
+++ src/Main.cpp
@@ -54,6 +54,8 @@
 #include <sys/time.h>
 #endif
 
+#include <endian.h>
+
 #include "osal_dynamiclib.h"
 
 #define G64_VERSION "Mupen64Plus"
@@ -634,11 +636,7 @@ void guLoadTextures ()
   for (i=0; i<0x200; i++)
   {
     // cur = ~*(data++), byteswapped
-#if !defined(__GNUC__)
-     cur = _byteswap_ulong(~*(data++));
-#else
-     cur = __builtin_bswap32(~*(data++));
-#endif
+     cur = swap32(~*(data++));
 
     for (b=0x80000000; b!=0; b>>=1)
     {
@@ -714,7 +712,7 @@ BOOL InitGfx (BOOL evoodoo_using_window)
       WriteLog(M64MSG_INFO, "fb_hires\n");
     GRWINOPENEXT grSstWinOpenExt = (GRWINOPENEXT)grGetProcAddress("grSstWinOpenExt");
     if (grSstWinOpenExt)
-      gfx_context = grSstWinOpenExt ((FxU32)NULL,
+      gfx_context = grSstWinOpenExt ((uintptr_t)NULL,
       settings.res_data,
       GR_REFRESH_60Hz,
       GR_COLORFORMAT_RGBA,
@@ -724,7 +722,7 @@ BOOL InitGfx (BOOL evoodoo_using_window)
       1);   // 1 auxillary buffer
   }
   if (!gfx_context)
-    gfx_context = grSstWinOpen ((FxU32)NULL,
+    gfx_context = grSstWinOpen ((uintptr_t)NULL,
     settings.res_data,
     GR_REFRESH_60Hz,
     GR_COLORFORMAT_RGBA,
@@ -1204,7 +1202,7 @@ EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo
 {
   PluginInfo->Version = 0x0103;     // Set to 0x0103
   PluginInfo->Type  = PLUGIN_TYPE_GFX;  // Set to PLUGIN_TYPE_GFX
-  sprintf (PluginInfo->Name, "Glide64 "G64_VERSION);  // Name of the DLL
+  sprintf (PluginInfo->Name, "Glide64 " G64_VERSION);  // Name of the DLL
 
   // If DLL supports memory these memory options then set them to TRUE or FALSE
   //  if it does not support it
