Jelajahi Sumber

Fixes for win32

mingodad 8 tahun lalu
induk
melakukan
b19b3b8a64

+ 2 - 1
SquiLu-ext/mongoose.c

@@ -72,6 +72,7 @@
 #include <process.h>
 #include <direct.h>
 #include <io.h>
+typedef const char *SOCK_OPT_TYPE;
 #else // _WIN32_WCE
 #include <winsock2.h>
 #include <ws2tcpip.h>
@@ -1496,7 +1497,7 @@ static pid_t spawn_process(struct mg_connection *conn, const char *prog,
   if (CreateProcessA(NULL, cmdline, NULL, NULL, TRUE,
         CREATE_NEW_PROCESS_GROUP, envblk, dir, &si, &pi) == 0) {
     cry(conn, "%s: CreateProcess(%s): %d",
-        __func__, cmdline, ERRNO);
+        __func__, cmdline, (int)ERRNO);
     pi.hProcess = (pid_t) -1;
   }
 

+ 3 - 0
SquiLu-ext/sq_bitvector.cpp

@@ -4,6 +4,9 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>  /* for malloc */
+#ifdef _WIN32
+#include <malloc.h>  /* for alloc */
+#endif
 #include <assert.h>  /* for a few sanity tests */
 
 #include "sqlite3.h"

+ 2 - 0
SquiLu/sq/sq.c

@@ -624,7 +624,9 @@ static sq_modules_preload_st modules_preload[] = {
 #ifdef SQ_USE_FREETYPE
     {"freetype", sqext_register_freetype},
 #endif // SQ_USE_FREETYPE
+#ifdef SQ_USE_BLOSC
     {"blosc", sqext_register_sq_blosc},
+#endif // SQ_USE_BLOSC
 #endif
 #ifdef USE_AXTLS
     {"axtls", sqext_register_axtls},

+ 1 - 1
SquiLu/sqstdlib/sqstdsystem.cpp

@@ -371,7 +371,7 @@ static SQRESULT  _system_sleep(HSQUIRRELVM v)
 #ifndef _WIN32_WCE
 #include <sys/timeb.h>
 
-#if !(defined(TARGET_IOS) || defined(__APPLE__))
+#if !(defined(TARGET_IOS) || defined(__APPLE__) || defined(_WIN32))
 static int sqftime(struct timeb *tp)
 {
 	struct timespec ts;