Skip to content

Commit 5afbb73

Browse files
authored
Merge branch 'HaxeFoundation:master' into patch-3
2 parents b55f953 + 86d4b1a commit 5afbb73

82 files changed

Lines changed: 1520 additions & 1914 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Changes.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
11

2+
4.3.xx
3+
------------------------------------------------------------
4+
5+
* Added support for killing processes on OS' other than Windows, Apple TV, and Apple Watch
6+
* Added register capturing on Linux
7+
* Added HXCPP_CPP17 define
8+
* Added ASM and NASM support to build xml
9+
* Added support for name and value entries to build xml
10+
* Added tracy profiler
11+
* Added support for Android NDKs higher than 21
12+
* Added x86_64 support to older Android NDKs
13+
* Added optional detaching of main thread
14+
15+
* Updated mbedtls to 2.28.2
16+
* Updated sqlite to 3.40.1
17+
* Updated zlib to 1.2.13
18+
19+
* Fixed SSL socket non blocking handshake throwing an exception on 64bit Windows
20+
* Fixed Windows 64bit architecture detection
21+
* Fixed critial error handler returning the wrong callstack
22+
* Fixed ARM64 library names on Mac
23+
* Fixed generational GC when used with HXCPP_ALIGN_ALLOC
24+
* Fixed pthread structured being unaligned
25+
* Fixed cppia crash on functions with empty bodies
26+
* Fixed regression parsing integers which wrap around
27+
* Fixed compilation with HXCPP_GC_DEBUG_LEVEL define
28+
* Fixed compilation with MinGW
29+
* Fixed enum parameters potentially returning null
30+
* Fixed HXCPP_CLANG not being set when using clang
31+
* Fixed pcre2 and mbedtls not being compiled with the c99 standard
32+
* Fixed behaviour of indexOf and lastIndexOf on empty strings not aligning with other targets
33+
* Fixed behaviour of directory reading function not aligning with other targets
34+
* Fixed haxelib not being invoked with the current working directory
35+
36+
* Removed Haxe 3 support
37+
238
4.3
339
------------------------------------------------------------
440

include/hx/CFFIPrime.h

Lines changed: 69 additions & 64 deletions
Large diffs are not rendered by default.

include/hx/Debug.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ class StackCatchable
216216
bool (*mTestFunction)(Dynamic e);
217217
};
218218

219+
#if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
220+
// This is the function to call when a new script has been loaded.
221+
// Signature: Void -> Void
222+
extern Dynamic g_onScriptLoadedFunction;
223+
#endif
219224

220225

221226
#endif // HXCPP_DEBUGGER
@@ -298,6 +303,9 @@ void __hxcpp_dbg_setNewStackFrameFunction(Dynamic function);
298303
void __hxcpp_dbg_setNewThreadInfoFunction(Dynamic function);
299304
void __hxcpp_dbg_setAddParameterToStackFrameFunction(Dynamic function);
300305
void __hxcpp_dbg_setAddStackFrameToThreadInfoFunction(Dynamic function);
306+
#if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
307+
void __hxcpp_dbg_setOnScriptLoadedFunction(Dynamic function);
308+
#endif
301309

302310
bool __hxcpp_dbg_fix_critical_error(String inErr);
303311

@@ -351,6 +359,9 @@ inline void __hxcpp_dbg_setNewStackFrameFunction(Dynamic) { }
351359
inline void __hxcpp_dbg_setNewThreadInfoFunction(Dynamic) { }
352360
inline void __hxcpp_dbg_setAddParameterToStackFrameFunction(Dynamic) { }
353361
inline void __hxcpp_dbg_setAddStackFrameToThreadInfoFunction(Dynamic) { }
362+
#if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
363+
inline void __hxcpp_dbg_setOnScriptLoadedFunction(Dynamic) { }
364+
#endif
354365

355366
// The following functions are called by Thread.cpp to notify of thread
356367
// created and terminated

include/hx/HxcppMain.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,22 @@
9494
}
9595
catch (Dynamic e)
9696
{
97-
__hx_dump_stack();
98-
#ifdef HX_WIN_MAIN
99-
MessageBoxA(0, e==null() ? "null" : e->toString().__CStr(), "Error", 0);
100-
#else
101-
printf("Error : %s\n",e==null() ? "null" : e->toString().__CStr());
102-
#endif
103-
return -1;
97+
auto customStack = e->__Field(HX_CSTRING("_hx_customStack"), HX_PROP_DYNAMIC).asString();
98+
if (::hx::IsNotNull(customStack))
99+
{
100+
printf("%s\n", customStack.utf8_str());
101+
}
102+
else
103+
{
104+
__hx_dump_stack();
105+
}
106+
107+
#ifdef HX_WIN_MAIN
108+
MessageBoxA(0, e == null() ? "null" : e->toString().__CStr(), "Error", 0);
109+
#else
110+
printf("Error : %s\n", e == null() ? "null" : e->toString().__CStr());
111+
#endif
112+
return -1;
104113
}
105114
return 0;
106115
}

include/hx/StdLibs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ HXCPP_EXTERN_CLASS_ATTRIBUTES String __hxcpp_utf8_string_to_char_bytes(String &i
161161

162162
// --- HashRoot ---------------------------------------------------------------------
163163

164-
HXCPP_EXTERN_CLASS_ATTRIBUTES int __root_hash_size(Dynamic *rtHash);
164+
HXCPP_EXTERN_CLASS_ATTRIBUTES int __root_hash_size(Dynamic &rtHash);
165165

166166
// --- IntHash ----------------------------------------------------------------------
167167

project/thirdparty/mbedtls-files.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<set name="MBEDTLS_DIR" value="${HXCPP}/project/thirdparty/mbedtls-2.28.2" />
44

5-
<files id="mbedtls">
5+
<files id="mbedtls" tags="" >
66
<depend name="${this_dir}/mbedtls-files.xml" dateOnly="true" />
77
<cache value="true" asLibrary="true" />
88

project/thirdparty/zlib-1.2.13/zlib2ansi

Lines changed: 0 additions & 152 deletions
This file was deleted.

project/thirdparty/zlib-1.2.13/CMakeLists.txt renamed to project/thirdparty/zlib-1.3.1/CMakeLists.txt

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
cmake_minimum_required(VERSION 2.4.4)
1+
cmake_minimum_required(VERSION 2.4.4...3.15.0)
22
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33

44
project(zlib C)
55

6-
set(VERSION "1.2.13")
6+
set(VERSION "1.3.1")
7+
8+
option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
79

810
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
911
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
@@ -148,7 +150,9 @@ if(MINGW)
148150
endif(MINGW)
149151

150152
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
153+
target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
151154
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
155+
target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
152156
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
153157
set_target_properties(zlib PROPERTIES SOVERSION 1)
154158

@@ -166,7 +170,7 @@ endif()
166170
if(UNIX)
167171
# On unix-like platforms the library is almost always called libz
168172
set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
169-
if(NOT APPLE)
173+
if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
170174
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
171175
endif()
172176
elseif(BUILD_SHARED_LIBS AND WIN32)
@@ -193,21 +197,22 @@ endif()
193197
#============================================================================
194198
# Example binaries
195199
#============================================================================
196-
197-
add_executable(example test/example.c)
198-
target_link_libraries(example zlib)
199-
add_test(example example)
200-
201-
add_executable(minigzip test/minigzip.c)
202-
target_link_libraries(minigzip zlib)
203-
204-
if(HAVE_OFF64_T)
205-
add_executable(example64 test/example.c)
206-
target_link_libraries(example64 zlib)
207-
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
208-
add_test(example64 example64)
209-
210-
add_executable(minigzip64 test/minigzip.c)
211-
target_link_libraries(minigzip64 zlib)
212-
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
200+
if(ZLIB_BUILD_EXAMPLES)
201+
add_executable(example test/example.c)
202+
target_link_libraries(example zlib)
203+
add_test(example example)
204+
205+
add_executable(minigzip test/minigzip.c)
206+
target_link_libraries(minigzip zlib)
207+
208+
if(HAVE_OFF64_T)
209+
add_executable(example64 test/example.c)
210+
target_link_libraries(example64 zlib)
211+
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
212+
add_test(example64 example64)
213+
214+
add_executable(minigzip64 test/minigzip.c)
215+
target_link_libraries(minigzip64 zlib)
216+
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
217+
endif()
213218
endif()
Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.3.1 (22 Jan 2024)
5+
- Reject overflows of zip header fields in minizip
6+
- Fix bug in inflateSync() for data held in bit buffer
7+
- Add LIT_MEM define to use more memory for a small deflate speedup
8+
- Fix decision on the emission of Zip64 end records in minizip
9+
- Add bounds checking to ERR_MSG() macro, used by zError()
10+
- Neutralize zip file traversal attacks in miniunz
11+
- Fix a bug in ZLIB_DEBUG compiles in check_match()
12+
- Various portability and appearance improvements
13+
14+
Changes in 1.3 (18 Aug 2023)
15+
- Remove K&R function definitions and zlib2ansi
16+
- Fix bug in deflateBound() for level 0 and memLevel 9
17+
- Fix bug when gzungetc() is used immediately after gzopen()
18+
- Fix bug when using gzflush() with a very small buffer
19+
- Fix crash when gzsetparams() attempted for transparent write
20+
- Fix test/example.c to work with FORCE_STORED
21+
- Rewrite of zran in examples (see zran.c version history)
22+
- Fix minizip to allow it to open an empty zip file
23+
- Fix reading disk number start on zip64 files in minizip
24+
- Fix logic error in minizip argument processing
25+
- Add minizip testing to Makefile
26+
- Read multiple bytes instead of byte-by-byte in minizip unzip.c
27+
- Add memory sanitizer to configure (--memory)
28+
- Various portability improvements
29+
- Various documentation improvements
30+
- Various spelling and typo corrections
31+
432
Changes in 1.2.13 (13 Oct 2022)
533
- Fix configure issue that discarded provided CC definition
634
- Correct incorrect inputs provided to the CRC functions
@@ -1445,7 +1473,7 @@ Changes in 0.99 (27 Jan 96)
14451473
- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
14461474
- in fcalloc, normalize pointer if size > 65520 bytes
14471475
- don't use special fcalloc for 32 bit Borland C++
1448-
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
1476+
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc.
14491477
- use Z_BINARY instead of BINARY
14501478
- document that gzclose after gzdopen will close the file
14511479
- allow "a" as mode in gzopen

0 commit comments

Comments
 (0)