Update hashlink.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
https://github.com/HaxeFoundation/hashlink/wiki/
|
||||
**/
|
||||
|
||||
#define HL_VERSION 0x010A00
|
||||
#define HL_VERSION 0x010C00
|
||||
|
||||
#if defined(_WIN32)
|
||||
# define HL_WIN
|
||||
@@ -53,10 +53,8 @@
|
||||
|
||||
#if defined(linux) || defined(__linux__)
|
||||
# define HL_LINUX
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HL_IOS) || defined(HL_ANDROID) || defined(HL_TVOS)
|
||||
# define HL_MOBILE
|
||||
@@ -184,17 +182,13 @@
|
||||
#else
|
||||
# define C_FUNCTION_BEGIN
|
||||
# define C_FUNCTION_END
|
||||
# ifndef true
|
||||
# define true 1
|
||||
# define false 0
|
||||
typedef unsigned char bool;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef intptr_t int_val;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
@@ -211,9 +205,9 @@ typedef unsigned long long uint64;
|
||||
|
||||
#if defined(HL_WIN) && !defined(HL_LLVM)
|
||||
#if defined(HL_WIN_DESKTOP) && !defined(HL_MINGW)
|
||||
// # include <Windows.h>
|
||||
# include <Windows.h>
|
||||
#elif defined(HL_WIN_DESKTOP) && defined(HL_MINGW)
|
||||
// # include<windows.h>
|
||||
# include<windows.h>
|
||||
#else
|
||||
# include <xdk.h>
|
||||
#endif
|
||||
@@ -226,8 +220,8 @@ typedef wchar_t uchar;
|
||||
# define ustrlen wcslen
|
||||
# define ustrdup _wcsdup
|
||||
HL_API int uvszprintf( uchar *out, int out_size, const uchar *fmt, va_list arglist );
|
||||
# define utod(s,end) wcstod(s,end)
|
||||
# define utoi(s,end) wcstol(s,end,10)
|
||||
# define _utod(s,end) wcstod(s,end)
|
||||
# define _utoi(s,end) wcstol(s,end,10)
|
||||
# define ucmp(a,b) wcscmp(a,b)
|
||||
# define utostr(out,size,str) wcstombs(out,str,size)
|
||||
#elif defined(HL_MAC)
|
||||
@@ -239,39 +233,29 @@ typedef uint16_t uchar;
|
||||
#if defined(HL_IOS) || defined(HL_TVOS) || defined(HL_MAC)
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#ifdef HL_MAC
|
||||
typedef uint16_t char16_t;
|
||||
typedef uint32_t char32_t;
|
||||
#endif
|
||||
#elif defined(HL_NATIVE_UCHAR_FUN)
|
||||
#else
|
||||
# include <uchar.h>
|
||||
#elif __cplusplus <= 199711L
|
||||
# include <stdint.h>
|
||||
typedef uint16_t uchar16_t;
|
||||
typedef uint32_t uchar32_t;
|
||||
#ifndef EMSCRIPTEN
|
||||
typedef int32_t char32_t;
|
||||
typedef int16_t char16_t;
|
||||
#endif
|
||||
#endif
|
||||
typedef char16_t uchar;
|
||||
# undef USTR
|
||||
# define USTR(str) u##str
|
||||
#endif
|
||||
|
||||
#ifndef HL_NATIVE_UCHAR_FUN
|
||||
C_FUNCTION_BEGIN
|
||||
HL_API int ustrlen( const uchar *str );
|
||||
HL_API uchar *ustrdup( const uchar *str );
|
||||
HL_API double utod( const uchar *str, uchar **end );
|
||||
HL_API int utoi( const uchar *str, uchar **end );
|
||||
#ifndef HL_NATIVE_UCHAR_FUN
|
||||
HL_API int ustrlen( const uchar *str );
|
||||
HL_API uchar *ustrdup( const uchar *str );
|
||||
HL_API int ucmp( const uchar *a, const uchar *b );
|
||||
HL_API int utostr( char *out, int out_size, const uchar *str );
|
||||
HL_API int usprintf( uchar *out, int out_size, const uchar *fmt, ... );
|
||||
HL_API int uvszprintf( uchar *out, int out_size, const uchar *fmt, va_list arglist );
|
||||
HL_API void uprintf( const uchar *fmt, const uchar *str );
|
||||
C_FUNCTION_END
|
||||
#endif
|
||||
C_FUNCTION_END
|
||||
|
||||
#if defined(HL_VCC)
|
||||
# define hl_debug_break() if( IsDebuggerPresent() ) __debugbreak()
|
||||
@@ -297,6 +281,11 @@ C_FUNCTION_END
|
||||
".long 0b;" \
|
||||
".popsection")
|
||||
# endif
|
||||
#elif defined(HL_MAC)
|
||||
#include <signal.h>
|
||||
# define hl_debug_break() \
|
||||
if( hl_detect_debugger() ) \
|
||||
raise(SIGTRAP);//__builtin_trap();
|
||||
#else
|
||||
# define hl_debug_break()
|
||||
#endif
|
||||
@@ -494,7 +483,7 @@ typedef struct _vclosure {
|
||||
void *fun;
|
||||
int hasValue;
|
||||
# ifdef HL_64
|
||||
int __pad;
|
||||
int stackCount;
|
||||
# endif
|
||||
void *value;
|
||||
} vclosure;
|
||||
@@ -535,7 +524,9 @@ struct hl_runtime_obj {
|
||||
vdynamic *(*getFieldFun)( vdynamic *obj, int hfield );
|
||||
// relative
|
||||
int nlookup;
|
||||
int ninterfaces;
|
||||
hl_field_lookup *lookup;
|
||||
int *interfaces;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -601,6 +592,7 @@ HL_API vdynamic *hl_alloc_strbytes( const uchar *msg, ... );
|
||||
HL_API void hl_assert( void );
|
||||
HL_API HL_NO_RETURN( void hl_throw( vdynamic *v ) );
|
||||
HL_API HL_NO_RETURN( void hl_rethrow( vdynamic *v ) );
|
||||
HL_API HL_NO_RETURN( void hl_null_access( void ) );
|
||||
HL_API void hl_setup_longjump( void *j );
|
||||
HL_API void hl_setup_exception( void *resolve_symbol, void *capture_stack );
|
||||
HL_API void hl_dump_stack( void );
|
||||
@@ -675,9 +667,13 @@ HL_API vdynamic *hl_dyn_call_safe( vclosure *c, vdynamic **args, int nargs, bool
|
||||
|
||||
struct _hl_thread;
|
||||
struct _hl_mutex;
|
||||
struct _hl_semaphore;
|
||||
struct _hl_condition;
|
||||
struct _hl_tls;
|
||||
typedef struct _hl_thread hl_thread;
|
||||
typedef struct _hl_mutex hl_mutex;
|
||||
typedef struct _hl_semaphore hl_semaphore;
|
||||
typedef struct _hl_condition hl_condition;
|
||||
typedef struct _hl_tls hl_tls;
|
||||
|
||||
HL_API hl_thread *hl_thread_start( void *callback, void *param, bool withGC );
|
||||
@@ -692,6 +688,22 @@ HL_API bool hl_mutex_try_acquire( hl_mutex *l );
|
||||
HL_API void hl_mutex_release( hl_mutex *l );
|
||||
HL_API void hl_mutex_free( hl_mutex *l );
|
||||
|
||||
HL_API hl_semaphore *hl_semaphore_alloc(int value);
|
||||
HL_API void hl_semaphore_acquire(hl_semaphore *sem);
|
||||
HL_API bool hl_semaphore_try_acquire(hl_semaphore *sem, vdynamic *timeout);
|
||||
HL_API void hl_semaphore_release(hl_semaphore *sem);
|
||||
HL_API void hl_semaphore_free(hl_semaphore *sem);
|
||||
|
||||
HL_API hl_condition *hl_condition_alloc();
|
||||
HL_API void hl_condition_acquire(hl_condition *cond);
|
||||
HL_API bool hl_condition_try_acquire(hl_condition *cond);
|
||||
HL_API void hl_condition_release(hl_condition *cond);
|
||||
HL_API void hl_condition_wait(hl_condition *cond);
|
||||
HL_API bool hl_condition_timed_wait(hl_condition *cond, double timeout);
|
||||
HL_API void hl_condition_signal(hl_condition *cond);
|
||||
HL_API void hl_condition_broadcast(hl_condition *cond);
|
||||
HL_API void hl_condition_free(hl_condition *cond);
|
||||
|
||||
HL_API hl_tls *hl_tls_alloc( bool gc_value );
|
||||
HL_API void hl_tls_set( hl_tls *l, void *value );
|
||||
HL_API void *hl_tls_get( hl_tls *l );
|
||||
@@ -754,7 +766,7 @@ HL_API void hl_throw_buffer( hl_buffer *b );
|
||||
// ----------------------- FFI ------------------------------------------------------
|
||||
|
||||
// match GNU C++ mangling
|
||||
#define TYPE_STR "vcsilfdbBDPOATR??X?N"
|
||||
#define TYPE_STR "vcsilfdbBDPOATR??X?N?S"
|
||||
|
||||
#undef _VOID
|
||||
#define _NO_ARG
|
||||
@@ -776,6 +788,7 @@ HL_API void hl_throw_buffer( hl_buffer *b );
|
||||
#define _ABSTRACT(name) "X" #name "_"
|
||||
#undef _NULL
|
||||
#define _NULL(t) "N" t
|
||||
#define _STRUCT "S"
|
||||
|
||||
#undef _STRING
|
||||
#define _STRING _OBJ(_BYTES _I32)
|
||||
@@ -786,7 +799,7 @@ typedef struct {
|
||||
int length;
|
||||
} vstring;
|
||||
|
||||
// #define DEFINE_PRIM(t,name,args) DEFINE_PRIM_WITH_NAME(t,name,args,name)
|
||||
// this macro has been renamed from DEFINE_PRIM to DEFINE_HL_PRIM, because DEFINE_PRIM is already used
|
||||
#define DEFINE_HL_PRIM(t,name,args) DEFINE_PRIM_WITH_NAME(t,name,args,name)
|
||||
#define _DEFINE_PRIM_WITH_NAME(t,name,args,realName) C_FUNCTION_BEGIN EXPORT void *hlp_##realName( const char **sign ) { *sign = _FUN(t,args); return (void*)(&HL_NAME(name)); } C_FUNCTION_END
|
||||
|
||||
@@ -838,6 +851,7 @@ HL_API void *hl_fatal_error( const char *msg, const char *file, int line );
|
||||
HL_API void hl_fatal_fmt( const char *file, int line, const char *fmt, ...);
|
||||
HL_API void hl_sys_init(void **args, int nargs, void *hlfile);
|
||||
HL_API void hl_setup_callbacks(void *sc, void *gw);
|
||||
HL_API void hl_setup_callbacks2(void *sc, void *gw, int flags);
|
||||
HL_API void hl_setup_reload_check( void *freload, void *param );
|
||||
|
||||
#include <setjmp.h>
|
||||
@@ -855,7 +869,8 @@ struct _hl_trap_ctx {
|
||||
#define HL_EXC_CATCH_ALL 2
|
||||
#define HL_EXC_IS_THROW 4
|
||||
#define HL_THREAD_INVISIBLE 16
|
||||
#define HL_TREAD_TRACK_SHIFT 5
|
||||
#define HL_THREAD_PROFILER_PAUSED 32
|
||||
#define HL_TREAD_TRACK_SHIFT 16
|
||||
|
||||
#define HL_TRACK_ALLOC 1
|
||||
#define HL_TRACK_CAST 2
|
||||
@@ -863,6 +878,8 @@ struct _hl_trap_ctx {
|
||||
#define HL_TRACK_DYNCALL 8
|
||||
#define HL_TRACK_MASK (HL_TRACK_ALLOC | HL_TRACK_CAST | HL_TRACK_DYNFIELD | HL_TRACK_DYNCALL)
|
||||
|
||||
#define HL_MAX_EXTRA_STACK 64
|
||||
|
||||
typedef struct {
|
||||
int thread_id;
|
||||
// gc vars
|
||||
@@ -879,6 +896,8 @@ typedef struct {
|
||||
// extra
|
||||
jmp_buf gc_regs;
|
||||
void *exc_stack_trace[HL_EXC_MAX_STACK];
|
||||
void *extra_stack_data[HL_MAX_EXTRA_STACK];
|
||||
int extra_stack_size;
|
||||
} hl_thread_info;
|
||||
|
||||
HL_API hl_thread_info *hl_get_thread();
|
||||
|
||||
BIN
templates/bin/hl/linux/fmt.hdll
Executable file
BIN
templates/bin/hl/linux/fmt.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/linux/hl
Executable file
BIN
templates/bin/hl/linux/hl
Executable file
Binary file not shown.
BIN
templates/bin/hl/linux/libhl.so
Executable file
BIN
templates/bin/hl/linux/libhl.so
Executable file
Binary file not shown.
BIN
templates/bin/hl/linux/mysql.hdll
Executable file
BIN
templates/bin/hl/linux/mysql.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/linux/ssl.hdll
Executable file
BIN
templates/bin/hl/linux/ssl.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/linux/ui.hdll
Executable file
BIN
templates/bin/hl/linux/ui.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/linux/uv.hdll
Executable file
BIN
templates/bin/hl/linux/uv.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/mac/fmt.hdll
Executable file
BIN
templates/bin/hl/mac/fmt.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/mac/hl
Executable file
BIN
templates/bin/hl/mac/hl
Executable file
Binary file not shown.
BIN
templates/bin/hl/mac/libhl.dylib
Executable file
BIN
templates/bin/hl/mac/libhl.dylib
Executable file
Binary file not shown.
BIN
templates/bin/hl/mac/mysql.hdll
Executable file
BIN
templates/bin/hl/mac/mysql.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/mac/ssl.hdll
Executable file
BIN
templates/bin/hl/mac/ssl.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/mac/ui.hdll
Executable file
BIN
templates/bin/hl/mac/ui.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/mac/uv.hdll
Executable file
BIN
templates/bin/hl/mac/uv.hdll
Executable file
Binary file not shown.
BIN
templates/bin/hl/windows/fmt.hdll
Normal file
BIN
templates/bin/hl/windows/fmt.hdll
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/fmt.lib
Normal file
BIN
templates/bin/hl/windows/fmt.lib
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/hl.exe
Normal file
BIN
templates/bin/hl/windows/hl.exe
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/hl.lib
Normal file
BIN
templates/bin/hl/windows/hl.lib
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/libhl.dll
Normal file
BIN
templates/bin/hl/windows/libhl.dll
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/libhl.lib
Normal file
BIN
templates/bin/hl/windows/libhl.lib
Normal file
Binary file not shown.
Binary file not shown.
BIN
templates/bin/hl/windows/mysql.hdll
Normal file
BIN
templates/bin/hl/windows/mysql.hdll
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/mysql.lib
Normal file
BIN
templates/bin/hl/windows/mysql.lib
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/sqlite.hdll
Normal file
BIN
templates/bin/hl/windows/sqlite.hdll
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/sqlite.lib
Normal file
BIN
templates/bin/hl/windows/sqlite.lib
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/ssl.hdll
Normal file
BIN
templates/bin/hl/windows/ssl.hdll
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/ssl.lib
Normal file
BIN
templates/bin/hl/windows/ssl.lib
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/ui.hdll
Normal file
BIN
templates/bin/hl/windows/ui.hdll
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/ui.lib
Normal file
BIN
templates/bin/hl/windows/ui.lib
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/uv.hdll
Normal file
BIN
templates/bin/hl/windows/uv.hdll
Normal file
Binary file not shown.
BIN
templates/bin/hl/windows/uv.lib
Normal file
BIN
templates/bin/hl/windows/uv.lib
Normal file
Binary file not shown.
Reference in New Issue
Block a user