r482 - trunk

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Feb 2 00:57:13 EST 2008


Author: icculus
Date: 2008-02-02 00:57:12 -0500 (Sat, 02 Feb 2008)
New Revision: 482

Modified:
   trunk/CMakeLists.txt
   trunk/fileio.c
   trunk/gui.h
   trunk/gui_www.c
   trunk/lua_glue.c
   trunk/mojosetup.c
   trunk/platform_windows.c
   trunk/universal.h
Log:
Windows fixes.

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/CMakeLists.txt	2008-02-02 05:57:12 UTC (rev 482)
@@ -59,6 +59,7 @@
     ADD_DEFINITIONS(-DPLATFORM_WINDOWS=1)
     ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1)
     SET(USES_WINMAIN WIN32)
+    SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} shell32)
 ENDIF(WINDOWS)
 
 IF(MACOSX)

Modified: trunk/fileio.c
===================================================================
--- trunk/fileio.c	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/fileio.c	2008-02-02 05:57:12 UTC (rev 482)
@@ -149,7 +149,7 @@
                 MojoPlatform_sleep(100);
             else
             {
-                br = in->read(in, scratchbuf_128k, maxread);
+                br = in->read(in, scratchbuf_128k, (uint32) maxread);
                 if (br == 0)  // we're done!
                     break;
                 else if (br < 0)

Modified: trunk/gui.h
===================================================================
--- trunk/gui.h	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/gui.h	2008-02-02 05:57:12 UTC (rev 482)
@@ -115,6 +115,13 @@
 void MojoGui_deinitGuiPlugin(void);
 #else
 
+// can't use normal STUBBED in gui plugins, since it references logDebug
+//  without entry-> ...
+#ifndef DOXYGEN_SHOULD_IGNORE_THIS
+#undef STUBBED
+#define STUBBED(x) STUBBED2(entry->,x)
+#endif
+
 __EXPORT__ const MojoGui *MOJOGUI_ENTRY_POINT(int revision,
                                               const MojoSetupEntryPoints *e);
 

Modified: trunk/gui_www.c
===================================================================
--- trunk/gui_www.c	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/gui_www.c	2008-02-02 05:57:12 UTC (rev 482)
@@ -43,6 +43,7 @@
     static const char *sockStrErrVal(int val)
     {
         STUBBED("Windows strerror");
+        return "sockStrErrVal() is unimplemented.";
     } // sockStrErrVal
 
 

Modified: trunk/lua_glue.c
===================================================================
--- trunk/lua_glue.c	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/lua_glue.c	2008-02-02 05:57:12 UTC (rev 482)
@@ -1567,9 +1567,9 @@
     char *locale = (envr != NULL) ? xstrdup(envr) : MojoPlatform_locale();
     char *ostype = MojoPlatform_osType();
     char *osversion = MojoPlatform_osVersion();
-    lua_Integer uid = MojoPlatform_getuid();
-    lua_Integer euid = MojoPlatform_geteuid();
-    lua_Integer gid = MojoPlatform_getgid();
+    lua_Integer uid = (lua_Integer) MojoPlatform_getuid();
+    lua_Integer euid = (lua_Integer) MojoPlatform_geteuid();
+    lua_Integer gid = (lua_Integer) MojoPlatform_getgid();
 
     #if DISABLE_LUA_PARSER
     const boolean luaparser = false;

Modified: trunk/mojosetup.c
===================================================================
--- trunk/mojosetup.c	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/mojosetup.c	2008-02-02 05:57:12 UTC (rev 482)
@@ -675,7 +675,7 @@
 #if MOJOSETUP_INTERNAL_BZLIB && BZ_NO_STDIO
 void bz_internal_error(int errcode)
 {
-    fatal(_("bzlib triggered an internal error: %0"), numstr(numbuf));
+    fatal(_("bzlib triggered an internal error: %0"), numstr(errcode));
 } // bz_internal_error
 #endif
 

Modified: trunk/platform_windows.c
===================================================================
--- trunk/platform_windows.c	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/platform_windows.c	2008-02-02 05:57:12 UTC (rev 482)
@@ -20,7 +20,9 @@
 #undef UNICODE
 #endif
 
+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
+#include <shellapi.h>
 
 // is Win95/Win98/WinME?  (no Unicode, etc)
 static boolean osIsWin9x = false;
@@ -640,7 +642,7 @@
     // msdn says:
     // "Returns a value greater than 32 if successful, or an error value that
     //  is less than or equal to 32 otherwise."
-    return (ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL) > 32);
+    return (((int) ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL)) > 32);
 } // MojoPlatform_launchBrowser
 
 
@@ -968,9 +970,9 @@
 char *MojoPlatform_osVersion(void)
 {
     return format("%0.%1.%2",
-                  numStr(osMajorVer),
-                  numStr(osMinorVer),
-                  numStr(osBuildVer));
+                  numstr(osMajorVer),
+                  numstr(osMinorVer),
+                  numstr(osBuildVer));
 } // MojoPlatform_osversion
 
 

Modified: trunk/universal.h
===================================================================
--- trunk/universal.h	2008-02-02 04:46:01 UTC (rev 481)
+++ trunk/universal.h	2008-02-02 05:57:12 UTC (rev 482)
@@ -365,16 +365,17 @@
 #define DEFINE_TO_STR(x) DEFINE_TO_STR2(x)
 
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
-#define STUBBED(x) \
+#define STUBBED2(prelog, x) \
 do { \
     static boolean seen_this = false; \
     if (!seen_this) \
     { \
         seen_this = true; \
-        logDebug("STUBBED: %0 at %1 (%2:%3)\n", x, __FUNCTION__, \
-                __FILE__, DEFINE_TO_STR(__LINE__)); \
+        prelog logDebug("STUBBED: %0 at %1 (%2:%3)\n", x, __FUNCTION__, \
+               __FILE__, DEFINE_TO_STR(__LINE__)); \
     } \
 } while (false)
+#define STUBBED(x) STUBBED2(,x)
 #endif
 
 #define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) )




More information about the mojosetup-commits mailing list