浏览代码

Merge branch 'master' of github.com:haxefoundation/hashlink

ncannasse 6 年之前
父节点
当前提交
6491a6d76a
共有 3 个文件被更改,包括 20 次插入14 次删除
  1. 5 5
      README.md
  2. 6 4
      src/hl.h
  3. 9 5
      src/hlc_main.c

+ 5 - 5
README.md

@@ -10,11 +10,11 @@ HashLink is a virtual machine for Haxe https://hashlink.haxe.org
 
 HashLink is distributed with some graphics libraries allowing to develop various applications, you can manually disable the libraries you want to compile in Makefile. Here's the dependencies that you install in order to compile all the libraries:
 
-fmt: libpng-dev libturbojpeg-dev libvorbis-dev
-openal: libopenal-dev
-sdl: libsdl2-dev
-ssl: libmbedtls-dev
-uv: libuv1-dev
+  * fmt: libpng-dev libturbojpeg-dev libvorbis-dev
+  * openal: libopenal-dev
+  * sdl: libsdl2-dev
+  * ssl: libmbedtls-dev
+  * uv: libuv1-dev
 
 To install all dependencies on the latest Ubuntu, for example:
 

+ 6 - 4
src/hl.h

@@ -23,7 +23,7 @@
 #define HL_H
 
 /**
-	Detailed documentation can be found here: 
+	Detailed documentation can be found here:
 	https://github.com/HaxeFoundation/hashlink/wiki/
 **/
 
@@ -204,8 +204,10 @@ typedef unsigned long long uint64;
 // -------------- UNICODE -----------------------------------
 
 #if defined(HL_WIN) && !defined(HL_LLVM)
-#ifdef HL_WIN_DESKTOP
+#if defined(HL_WIN_DESKTOP) && !defined(HL_MINGW)
 #	include <Windows.h>
+#elif defined(HL_WIN_DESKTOP) && defined(HL_MINGW)
+#	include<windows.h>
 #else
 #	include <xdk.h>
 #endif
@@ -758,9 +760,9 @@ typedef struct {
 #	endif
 #elif defined(LIBHL_STATIC)
 #	ifdef __cplusplus
-#		define	HL_PRIM				extern "C" 
+#		define	HL_PRIM				extern "C"
 #	else
-#		define	HL_PRIM				
+#		define	HL_PRIM
 #	endif
 #define DEFINE_PRIM_WITH_NAME(t,name,args,realName)
 #else

+ 9 - 5
src/hlc_main.c

@@ -28,7 +28,11 @@
 #ifdef HL_WIN_DESKTOP
 #	define CONST
 #	pragma warning(disable:4091)
+#if !defined(HL_MINGW)
 #	include <DbgHelp.h>
+#else
+#	include <dbghelp.h>
+#endif
 #	pragma comment(lib, "Dbghelp.lib")
 #	undef CONST
 #endif
@@ -125,11 +129,11 @@ int main(int argc, char *argv[]) {
 	cl.fun = hl_entry_point;
 	ret = hl_dyn_call_safe(&cl, NULL, 0, &isExc);
 	if( isExc ) {
-		varray *a = hl_exception_stack();
-		int i;
-		uprintf(USTR("Uncaught exception: %s\n"), hl_to_string(ret));
-		for (i = 0; i<a->size; i++)
-			uprintf(USTR("Called from %s\n"), hl_aptr(a, uchar*)[i]);
+		varray *a = hl_exception_stack();
+		int i;
+		uprintf(USTR("Uncaught exception: %s\n"), hl_to_string(ret));
+		for (i = 0; i<a->size; i++)
+			uprintf(USTR("Called from %s\n"), hl_aptr(a, uchar*)[i]);
 	}
 	hl_global_free();
 	sys_global_exit();