├── .gitattributes ├── .github └── workflows │ ├── main.yml │ ├── package.yml │ ├── setup │ └── action.yml │ └── test.yml ├── .gitignore ├── Changes.md ├── LICENSE.txt ├── README.md ├── build-tool └── BuildCommon.xml ├── docs ├── CompileCache.md ├── ThreadsAndStacks.md └── build_xml │ ├── Compiler.md │ ├── Defines.md │ ├── Files.md │ ├── HaxeTarget.md │ ├── Linker.md │ ├── README.md │ ├── Stripper.md │ ├── Tags.md │ ├── Targets.md │ ├── TopLevel.md │ ├── XmlInjection.md │ └── example.xml ├── haxelib.json ├── haxelib.xml ├── hxcpp ├── Builder.hx └── NekoInit.hx ├── include ├── Array.h ├── Dynamic.h ├── Enum.h ├── cpp │ ├── CppInt32__.h │ ├── FastIterator.h │ ├── Int64.h │ ├── Pointer.h │ ├── Variant.h │ └── VirtualArray.h ├── hx │ ├── Anon.h │ ├── Boot.h │ ├── CFFI.h │ ├── CFFIAPI.h │ ├── CFFIJsPrime.h │ ├── CFFILoader.h │ ├── CFFINekoLoader.h │ ├── CFFIPrime.h │ ├── Class.h │ ├── Debug.h │ ├── DynamicImpl.h │ ├── DynamicImpl.tpl │ ├── ErrorCodes.h │ ├── FieldRef.h │ ├── Functions.h │ ├── GC.h │ ├── GcTypeInference.h │ ├── GenMacro.hx │ ├── HeaderVersion.h │ ├── HxcppMain.h │ ├── IndexRef.h │ ├── Interface.h │ ├── LessThanEq.h │ ├── Macros.h │ ├── Macros.tpl │ ├── MacrosFixed.h │ ├── MacrosJumbo.h │ ├── MacrosJumbo.tpl │ ├── Memory.h │ ├── Native.h │ ├── NekoFunc.h │ ├── OS.h │ ├── ObjcHelpers.h │ ├── Object.h │ ├── Operators.h │ ├── QuickVec.h │ ├── Scriptable.h │ ├── StackContext.h │ ├── StdLibs.h │ ├── StdString.h │ ├── StringAlloc.h │ ├── Telemetry.h │ ├── TelemetryTracy.h │ ├── Thread.h │ ├── Tls.h │ ├── Undefine.h │ └── Unordered.h ├── hxMath.h ├── hxString.h ├── hxcpp.h └── null.h ├── java └── org │ └── haxe │ └── HXCPP.java ├── project ├── Build.xml ├── compile-cppia-arm64.hxml ├── compile-cppia.hxml └── thirdparty │ ├── Makefile │ ├── config │ └── mbedtls │ │ └── include │ │ ├── mbedtls_config.h │ │ └── threading_alt.h │ ├── mbedtls-2.28.2 │ ├── .gitattributes │ ├── .gitignore │ ├── .globalrc │ ├── .mypy.ini │ ├── .pylintrc │ ├── .travis.yml │ ├── BRANCHES.md │ ├── BUGS.md │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── ChangeLog │ ├── DartConfiguration.tcl │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── SECURITY.md │ ├── SUPPORT.md │ ├── dco.txt │ ├── include │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── mbedtls │ │ │ ├── aes.h │ │ │ ├── aesni.h │ │ │ ├── arc4.h │ │ │ ├── aria.h │ │ │ ├── asn1.h │ │ │ ├── asn1write.h │ │ │ ├── base64.h │ │ │ ├── bignum.h │ │ │ ├── blowfish.h │ │ │ ├── bn_mul.h │ │ │ ├── camellia.h │ │ │ ├── ccm.h │ │ │ ├── certs.h │ │ │ ├── chacha20.h │ │ │ ├── chachapoly.h │ │ │ ├── check_config.h │ │ │ ├── cipher.h │ │ │ ├── cipher_internal.h │ │ │ ├── cmac.h │ │ │ ├── compat-1.3.h │ │ │ ├── config.h │ │ │ ├── config_psa.h │ │ │ ├── constant_time.h │ │ │ ├── ctr_drbg.h │ │ │ ├── debug.h │ │ │ ├── des.h │ │ │ ├── dhm.h │ │ │ ├── ecdh.h │ │ │ ├── ecdsa.h │ │ │ ├── ecjpake.h │ │ │ ├── ecp.h │ │ │ ├── ecp_internal.h │ │ │ ├── entropy.h │ │ │ ├── entropy_poll.h │ │ │ ├── error.h │ │ │ ├── gcm.h │ │ │ ├── havege.h │ │ │ ├── hkdf.h │ │ │ ├── hmac_drbg.h │ │ │ ├── md.h │ │ │ ├── md2.h │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── md_internal.h │ │ │ ├── memory_buffer_alloc.h │ │ │ ├── net.h │ │ │ ├── net_sockets.h │ │ │ ├── nist_kw.h │ │ │ ├── oid.h │ │ │ ├── padlock.h │ │ │ ├── pem.h │ │ │ ├── pk.h │ │ │ ├── pk_internal.h │ │ │ ├── pkcs11.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs5.h │ │ │ ├── platform.h │ │ │ ├── platform_time.h │ │ │ ├── platform_util.h │ │ │ ├── poly1305.h │ │ │ ├── psa_util.h │ │ │ ├── ripemd160.h │ │ │ ├── rsa.h │ │ │ ├── rsa_internal.h │ │ │ ├── sha1.h │ │ │ ├── sha256.h │ │ │ ├── sha512.h │ │ │ ├── ssl.h │ │ │ ├── ssl_cache.h │ │ │ ├── ssl_ciphersuites.h │ │ │ ├── ssl_cookie.h │ │ │ ├── ssl_internal.h │ │ │ ├── ssl_ticket.h │ │ │ ├── threading.h │ │ │ ├── timing.h │ │ │ ├── version.h │ │ │ ├── x509.h │ │ │ ├── x509_crl.h │ │ │ ├── x509_crt.h │ │ │ ├── x509_csr.h │ │ │ └── xtea.h │ │ └── psa │ │ │ ├── crypto.h │ │ │ ├── crypto_builtin_composites.h │ │ │ ├── crypto_builtin_primitives.h │ │ │ ├── crypto_compat.h │ │ │ ├── crypto_config.h │ │ │ ├── crypto_driver_common.h │ │ │ ├── crypto_driver_contexts_composites.h │ │ │ ├── crypto_driver_contexts_primitives.h │ │ │ ├── crypto_extra.h │ │ │ ├── crypto_platform.h │ │ │ ├── crypto_se_driver.h │ │ │ ├── crypto_sizes.h │ │ │ ├── crypto_struct.h │ │ │ ├── crypto_types.h │ │ │ └── crypto_values.h │ └── library │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── Makefile │ │ ├── aes.c │ │ ├── aesni.c │ │ ├── arc4.c │ │ ├── aria.c │ │ ├── asn1parse.c │ │ ├── asn1write.c │ │ ├── base64.c │ │ ├── bignum.c │ │ ├── blowfish.c │ │ ├── camellia.c │ │ ├── ccm.c │ │ ├── certs.c │ │ ├── chacha20.c │ │ ├── chachapoly.c │ │ ├── check_crypto_config.h │ │ ├── cipher.c │ │ ├── cipher_wrap.c │ │ ├── cmac.c │ │ ├── common.h │ │ ├── constant_time.c │ │ ├── constant_time_internal.h │ │ ├── constant_time_invasive.h │ │ ├── ctr_drbg.c │ │ ├── debug.c │ │ ├── des.c │ │ ├── dhm.c │ │ ├── ecdh.c │ │ ├── ecdsa.c │ │ ├── ecjpake.c │ │ ├── ecp.c │ │ ├── ecp_curves.c │ │ ├── ecp_invasive.h │ │ ├── entropy.c │ │ ├── entropy_poll.c │ │ ├── error.c │ │ ├── gcm.c │ │ ├── havege.c │ │ ├── hkdf.c │ │ ├── hmac_drbg.c │ │ ├── md.c │ │ ├── md2.c │ │ ├── md4.c │ │ ├── md5.c │ │ ├── memory_buffer_alloc.c │ │ ├── mps_common.h │ │ ├── mps_error.h │ │ ├── mps_reader.c │ │ ├── mps_reader.h │ │ ├── mps_trace.c │ │ ├── mps_trace.h │ │ ├── net_sockets.c │ │ ├── nist_kw.c │ │ ├── oid.c │ │ ├── padlock.c │ │ ├── pem.c │ │ ├── pk.c │ │ ├── pk_wrap.c │ │ ├── pkcs11.c │ │ ├── pkcs12.c │ │ ├── pkcs5.c │ │ ├── pkparse.c │ │ ├── pkwrite.c │ │ ├── platform.c │ │ ├── platform_util.c │ │ ├── poly1305.c │ │ ├── psa_crypto.c │ │ ├── psa_crypto_aead.c │ │ ├── psa_crypto_aead.h │ │ ├── psa_crypto_cipher.c │ │ ├── psa_crypto_cipher.h │ │ ├── psa_crypto_client.c │ │ ├── psa_crypto_core.h │ │ ├── psa_crypto_driver_wrappers.c │ │ ├── psa_crypto_driver_wrappers.h │ │ ├── psa_crypto_ecp.c │ │ ├── psa_crypto_ecp.h │ │ ├── psa_crypto_hash.c │ │ ├── psa_crypto_hash.h │ │ ├── psa_crypto_invasive.h │ │ ├── psa_crypto_its.h │ │ ├── psa_crypto_mac.c │ │ ├── psa_crypto_mac.h │ │ ├── psa_crypto_random_impl.h │ │ ├── psa_crypto_rsa.c │ │ ├── psa_crypto_rsa.h │ │ ├── psa_crypto_se.c │ │ ├── psa_crypto_se.h │ │ ├── psa_crypto_slot_management.c │ │ ├── psa_crypto_slot_management.h │ │ ├── psa_crypto_storage.c │ │ ├── psa_crypto_storage.h │ │ ├── psa_its_file.c │ │ ├── ripemd160.c │ │ ├── rsa.c │ │ ├── rsa_internal.c │ │ ├── sha1.c │ │ ├── sha256.c │ │ ├── sha512.c │ │ ├── ssl_cache.c │ │ ├── ssl_ciphersuites.c │ │ ├── ssl_cli.c │ │ ├── ssl_cookie.c │ │ ├── ssl_msg.c │ │ ├── ssl_srv.c │ │ ├── ssl_ticket.c │ │ ├── ssl_tls.c │ │ ├── ssl_tls13_keys.c │ │ ├── ssl_tls13_keys.h │ │ ├── threading.c │ │ ├── timing.c │ │ ├── version.c │ │ ├── version_features.c │ │ ├── x509.c │ │ ├── x509_create.c │ │ ├── x509_crl.c │ │ ├── x509_crt.c │ │ ├── x509_csr.c │ │ ├── x509write_crt.c │ │ ├── x509write_csr.c │ │ └── xtea.c │ ├── mbedtls-files.xml │ ├── mbedtls-flags.xml │ ├── pcre2-10.42 │ ├── .bazelrc │ ├── .github │ │ └── workflows │ │ │ ├── build.yml │ │ │ ├── cifuzz.yml │ │ │ ├── codeql.yml │ │ │ └── scorecards.yml │ ├── 132html │ ├── AUTHORS │ ├── BUILD.bazel │ ├── CMakeLists.txt │ ├── COPYING │ ├── ChangeLog │ ├── CheckMan │ ├── CleanTxt │ ├── Detrail │ ├── HACKING │ ├── LICENCE │ ├── MODULE.bazel │ ├── Makefile.am │ ├── NEWS │ ├── NON-AUTOTOOLS-BUILD │ ├── PrepareRelease │ ├── README │ ├── README.md │ ├── RunGrepTest │ ├── RunGrepTest.bat │ ├── RunTest │ ├── RunTest.bat │ ├── WORKSPACE.bazel │ ├── autogen.sh │ ├── cmake │ │ ├── COPYING-CMAKE-SCRIPTS │ │ ├── FindEditline.cmake │ │ ├── FindPackageHandleStandardArgs.cmake │ │ ├── FindReadline.cmake │ │ ├── pcre2-config-version.cmake.in │ │ └── pcre2-config.cmake.in │ ├── config-cmake.h.in │ ├── configure.ac │ ├── index.md │ ├── libpcre2-16.pc.in │ ├── libpcre2-32.pc.in │ ├── libpcre2-8.pc.in │ ├── libpcre2-posix.pc.in │ ├── m4 │ │ ├── ax_pthread.m4 │ │ └── pcre2_visibility.m4 │ ├── maint │ │ ├── GenerateCommon.py │ │ ├── GenerateTest26.py │ │ ├── GenerateUcd.py │ │ ├── GenerateUcpHeader.py │ │ ├── GenerateUcpTables.py │ │ ├── ManyConfigTests │ │ ├── README │ │ ├── Unicode.tables │ │ │ ├── BidiMirroring.txt │ │ │ ├── CaseFolding.txt │ │ │ ├── DerivedBidiClass.txt │ │ │ ├── DerivedCoreProperties.txt │ │ │ ├── DerivedGeneralCategory.txt │ │ │ ├── GraphemeBreakProperty.txt │ │ │ ├── PropList.txt │ │ │ ├── PropertyAliases.txt │ │ │ ├── PropertyValueAliases.txt │ │ │ ├── ScriptExtensions.txt │ │ │ ├── Scripts.txt │ │ │ ├── UnicodeData.txt │ │ │ └── emoji-data.txt │ │ ├── pcre2_chartables.c.non-standard │ │ ├── ucptest.c │ │ ├── ucptestdata │ │ │ ├── testinput1 │ │ │ ├── testinput2 │ │ │ ├── testoutput1 │ │ │ └── testoutput2 │ │ └── utf8.c │ ├── pcre2-config.in │ ├── pcre2_fuzzer.dict │ ├── pcre2_fuzzer.options │ ├── perltest.sh │ └── src │ │ ├── config.h │ │ ├── config.h.in │ │ ├── pcre2.h │ │ ├── pcre2.h.in │ │ ├── pcre2_auto_possess.c │ │ ├── pcre2_chartables.c │ │ ├── pcre2_compile.c │ │ ├── pcre2_config.c │ │ ├── pcre2_context.c │ │ ├── pcre2_convert.c │ │ ├── pcre2_dfa_match.c │ │ ├── pcre2_dftables.c │ │ ├── pcre2_error.c │ │ ├── pcre2_extuni.c │ │ ├── pcre2_find_bracket.c │ │ ├── pcre2_fuzzsupport.c │ │ ├── pcre2_internal.h │ │ ├── pcre2_intmodedep.h │ │ ├── pcre2_jit_compile.c │ │ ├── pcre2_jit_match.c │ │ ├── pcre2_jit_misc.c │ │ ├── pcre2_jit_neon_inc.h │ │ ├── pcre2_jit_simd_inc.h │ │ ├── pcre2_jit_test.c │ │ ├── pcre2_maketables.c │ │ ├── pcre2_match.c │ │ ├── pcre2_match_data.c │ │ ├── pcre2_newline.c │ │ ├── pcre2_ord2utf.c │ │ ├── pcre2_pattern_info.c │ │ ├── pcre2_printint.c │ │ ├── pcre2_script_run.c │ │ ├── pcre2_serialize.c │ │ ├── pcre2_string_utils.c │ │ ├── pcre2_study.c │ │ ├── pcre2_substitute.c │ │ ├── pcre2_substring.c │ │ ├── pcre2_tables.c │ │ ├── pcre2_ucd.c │ │ ├── pcre2_ucp.h │ │ ├── pcre2_ucptables.c │ │ ├── pcre2_valid_utf.c │ │ ├── pcre2_xclass.c │ │ ├── pcre2demo.c │ │ ├── pcre2grep.c │ │ ├── pcre2posix.c │ │ ├── pcre2posix.h │ │ ├── pcre2posix_test.c │ │ ├── pcre2test.c │ │ └── sljit │ │ ├── sljitConfig.h │ │ ├── sljitConfigInternal.h │ │ ├── sljitExecAllocator.c │ │ ├── sljitLir.c │ │ ├── sljitLir.h │ │ ├── sljitNativeARM_32.c │ │ ├── sljitNativeARM_64.c │ │ ├── sljitNativeARM_T2_32.c │ │ ├── sljitNativeMIPS_32.c │ │ ├── sljitNativeMIPS_64.c │ │ ├── sljitNativeMIPS_common.c │ │ ├── sljitNativePPC_32.c │ │ ├── sljitNativePPC_64.c │ │ ├── sljitNativePPC_common.c │ │ ├── sljitNativeRISCV_32.c │ │ ├── sljitNativeRISCV_64.c │ │ ├── sljitNativeRISCV_common.c │ │ ├── sljitNativeS390X.c │ │ ├── sljitNativeX86_32.c │ │ ├── sljitNativeX86_64.c │ │ ├── sljitNativeX86_common.c │ │ ├── sljitProtExecAllocator.c │ │ ├── sljitUtils.c │ │ └── sljitWXExecAllocator.c │ ├── sqlite-3.40.1 │ ├── shell.c │ ├── sqlite3.c │ ├── sqlite3.h │ └── sqlite3ext.h │ ├── tracy-0.12.0 │ ├── README.md │ ├── TracyClient.cpp │ ├── client │ │ ├── TracyAlloc.cpp │ │ ├── TracyArmCpuTable.hpp │ │ ├── TracyCallstack.cpp │ │ ├── TracyCallstack.h │ │ ├── TracyCallstack.hpp │ │ ├── TracyCpuid.hpp │ │ ├── TracyDebug.hpp │ │ ├── TracyDxt1.cpp │ │ ├── TracyDxt1.hpp │ │ ├── TracyFastVector.hpp │ │ ├── TracyKCore.cpp │ │ ├── TracyKCore.hpp │ │ ├── TracyLock.hpp │ │ ├── TracyOverride.cpp │ │ ├── TracyProfiler.cpp │ │ ├── TracyProfiler.hpp │ │ ├── TracyRingBuffer.hpp │ │ ├── TracyScoped.hpp │ │ ├── TracyStringHelpers.hpp │ │ ├── TracySysPower.cpp │ │ ├── TracySysPower.hpp │ │ ├── TracySysTime.cpp │ │ ├── TracySysTime.hpp │ │ ├── TracySysTrace.cpp │ │ ├── TracySysTrace.hpp │ │ ├── TracyThread.hpp │ │ ├── tracy_SPSCQueue.h │ │ ├── tracy_concurrentqueue.h │ │ ├── tracy_rpmalloc.cpp │ │ └── tracy_rpmalloc.hpp │ ├── common │ │ ├── TracyAlign.hpp │ │ ├── TracyAlloc.hpp │ │ ├── TracyApi.h │ │ ├── TracyColor.hpp │ │ ├── TracyForceInline.hpp │ │ ├── TracyMutex.hpp │ │ ├── TracyProtocol.hpp │ │ ├── TracyQueue.hpp │ │ ├── TracySocket.cpp │ │ ├── TracySocket.hpp │ │ ├── TracyStackFrames.cpp │ │ ├── TracyStackFrames.hpp │ │ ├── TracySystem.cpp │ │ ├── TracySystem.hpp │ │ ├── TracyUwp.hpp │ │ ├── TracyVersion.hpp │ │ ├── TracyYield.hpp │ │ ├── tracy_lz4.cpp │ │ ├── tracy_lz4.hpp │ │ ├── tracy_lz4hc.cpp │ │ └── tracy_lz4hc.hpp │ ├── libbacktrace │ │ ├── LICENSE │ │ ├── alloc.cpp │ │ ├── backtrace.hpp │ │ ├── config.h │ │ ├── dwarf.cpp │ │ ├── elf.cpp │ │ ├── fileline.cpp │ │ ├── filenames.hpp │ │ ├── internal.hpp │ │ ├── macho.cpp │ │ ├── mmapio.cpp │ │ ├── posix.cpp │ │ ├── sort.cpp │ │ └── state.cpp │ └── tracy │ │ ├── Tracy.hpp │ │ ├── TracyC.h │ │ ├── TracyCUDA.hpp │ │ ├── TracyD3D11.hpp │ │ ├── TracyD3D12.hpp │ │ ├── TracyLua.hpp │ │ ├── TracyMetal.hmm │ │ ├── TracyOpenCL.hpp │ │ ├── TracyOpenGL.hpp │ │ └── TracyVulkan.hpp │ └── zlib-1.3.1 │ ├── CMakeLists.txt │ ├── ChangeLog │ ├── FAQ │ ├── INDEX │ ├── LICENSE │ ├── Makefile │ ├── Makefile.in │ ├── README │ ├── adler32.c │ ├── compress.c │ ├── configure │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── gzclose.c │ ├── gzguts.h │ ├── gzlib.c │ ├── gzread.c │ ├── gzwrite.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── make_vms.com │ ├── treebuild.xml │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── zconf.h │ ├── zconf.h.cmakein │ ├── zconf.h.in │ ├── zlib.3 │ ├── zlib.3.pdf │ ├── zlib.h │ ├── zlib.map │ ├── zlib.pc.cmakein │ ├── zlib.pc.in │ ├── zutil.c │ └── zutil.h ├── run.n ├── src ├── Array.cpp ├── Dynamic.cpp ├── Enum.cpp ├── ExampleMain.cpp ├── Math.cpp ├── ObjcData.mm ├── String.cpp └── hx │ ├── AbcOpCodes.h │ ├── AndroidCompat.cpp │ ├── Anon.cpp │ ├── Boot.cpp │ ├── CFFI.cpp │ ├── Class.cpp │ ├── Date.cpp │ ├── Debug.cpp │ ├── Debugger.cpp │ ├── Hash.cpp │ ├── Hash.h │ ├── Lib.cpp │ ├── NoFiles.cpp │ ├── Object.cpp │ ├── Profiler.cpp │ ├── RunLibs.cpp │ ├── StdLibs.cpp │ ├── Telemetry.cpp │ ├── TelemetryTracy.cpp │ ├── Thread.cpp │ ├── Unicase.h │ ├── cppia │ ├── ArrayBuiltin.cpp │ ├── ArrayVirtual.cpp │ ├── Cppia.cpp │ ├── Cppia.h │ ├── CppiaClasses.cpp │ ├── CppiaCompiler.cpp │ ├── CppiaCompiler.h │ ├── CppiaCtx.cpp │ ├── CppiaFunction.cpp │ ├── CppiaModule.cpp │ ├── CppiaOps.inc │ ├── CppiaStream.h │ ├── CppiaVars.cpp │ ├── GlobalBuiltin.cpp │ ├── HaxeNative.cpp │ ├── StringBuiltin.cpp │ └── sljit_src │ │ ├── README │ │ ├── sljitConfig.h │ │ ├── sljitConfigInternal.h │ │ ├── sljitExecAllocator.c │ │ ├── sljitLir.c │ │ ├── sljitLir.h │ │ ├── sljitNativeARM_32.c │ │ ├── sljitNativeARM_64.c │ │ ├── sljitNativeARM_T2_32.c │ │ ├── sljitNativeMIPS_32.c │ │ ├── sljitNativeMIPS_64.c │ │ ├── sljitNativeMIPS_common.c │ │ ├── sljitNativePPC_32.c │ │ ├── sljitNativePPC_64.c │ │ ├── sljitNativePPC_common.c │ │ ├── sljitNativeSPARC_32.c │ │ ├── sljitNativeSPARC_common.c │ │ ├── sljitNativeTILEGX-encoder.c │ │ ├── sljitNativeTILEGX_64.c │ │ ├── sljitNativeX86_32.c │ │ ├── sljitNativeX86_64.c │ │ ├── sljitNativeX86_common.c │ │ ├── sljitProtExecAllocator.c │ │ └── sljitUtils.c │ ├── gc │ ├── GcCommon.cpp │ ├── GcRegCapture.cpp │ ├── GcRegCapture.h │ └── Immix.cpp │ └── libs │ ├── mysql │ ├── Build.xml │ ├── Mysql.cpp │ ├── my_api.cpp │ ├── my_proto.cpp │ ├── my_proto.h │ ├── mysql.h │ ├── sha1.cpp │ ├── sha1.h │ ├── socket.cpp │ └── socket.h │ ├── regexp │ ├── Build.xml │ ├── RegExp.cpp │ └── pcre2_sources.xml │ ├── sqlite │ ├── Build.xml │ └── Sqlite.cpp │ ├── ssl │ ├── Build.xml │ └── SSL.cpp │ ├── std │ ├── Build.xml │ ├── File.cpp │ ├── Process.cpp │ ├── Random.cpp │ ├── Socket.cpp │ └── Sys.cpp │ └── zlib │ ├── Build.xml │ └── ZLib.cpp ├── test ├── README.md ├── RunTests.hx ├── cffi │ ├── compile-neko.hxml │ ├── compile-utf8.hxml │ ├── compile.hxml │ ├── project │ │ ├── Project.cpp │ │ └── build.xml │ └── src │ │ ├── Loader.hx │ │ ├── TestCffi.hx │ │ ├── TestMain.hx │ │ └── TestPrime.hx ├── cppia │ ├── Client.hx │ ├── ClientExtendedExtendedRoot.hx │ ├── ClientExtends.hx │ ├── ClientExtends2.hx │ ├── ClientIHostImpl.hx │ ├── Common.hx │ ├── CppiaHost.hx │ ├── HostBase.hx │ ├── HostExtendedRoot.hx │ ├── HostRoot.hx │ ├── IClientHostInterface.hx │ ├── IClientInterface.hx │ ├── IFoo.hx │ ├── IHostInterface.hx │ ├── LocalFunctionExceptions.hx │ ├── cases │ │ └── TestCommon.hx │ ├── compile-client.hxml │ ├── compile-host.hxml │ └── pack │ │ └── HostInterface.hx ├── debugger │ ├── App.hx │ ├── Lines.hx │ ├── TestDebugger.hx │ └── compile.hxml ├── extern-lib │ ├── api │ │ ├── HaxeApi.hx │ │ └── HaxeObject.hx │ ├── compile-api.hxml │ └── impl │ │ └── HaxeImpl.hx ├── extern-use │ ├── Build.xml │ └── Main.cpp ├── haxe │ ├── TestIntHash.hx │ ├── TestKeywords.hx │ ├── TestMain.hx │ ├── TestObjectHash.hx │ ├── TestSort.hx │ ├── TestStringHash.hx │ ├── TestTypes.hx │ ├── TestWeakHash.hx │ ├── compile.hxml │ ├── compile_nme.nmml │ ├── file │ │ ├── TestFile.hx │ │ └── empty.txt │ ├── gc │ │ ├── TestBigStack.hx │ │ ├── TestGC.hx │ │ ├── TestGCThreaded.hx │ │ └── ZoneTest.cpp │ └── native │ │ └── TestFinalizer.hx ├── native │ ├── Native.hx │ ├── NativeGen.hx │ ├── compile.hxml │ ├── externs │ │ ├── RGB.hx │ │ ├── Rectangle.hx │ │ ├── RectangleApi.hx │ │ ├── RectangleDef.h │ │ ├── RectangleImpl.cpp │ │ └── ShortPtr.hx │ ├── lib │ │ ├── LibInclude.h │ │ └── RGB.cpp │ └── tests │ │ ├── TestGlobalNamespace.hx │ │ ├── TestNativeEnum.hx │ │ ├── TestNativeGen.hx │ │ ├── TestNonVirtual.hx │ │ ├── TestPtr.hx │ │ ├── TestRectangle.hx │ │ ├── TestRgb.hx │ │ └── TestStdio.hx ├── opMatrix │ └── MkOps.hx ├── snippets │ └── messagebox │ │ ├── MessageBox.hx │ │ └── compile.hxml ├── std │ ├── Test.hx │ ├── Test.nmml │ ├── compile32.hxml │ ├── compile64.hxml │ ├── compileArm64.hxml │ └── testAndroid.hxml ├── telemetry │ ├── TestBasic.hx │ ├── TestMain.hx │ ├── compile.hxml │ └── test.bat └── threads │ ├── Test.hx │ ├── ThreadCode.cpp │ ├── a.txt │ └── compile.hxml ├── toolchain ├── android-toolchain-clang.xml ├── android-toolchain-gcc.xml ├── android-toolchain.xml ├── appletvos-toolchain.xml ├── appletvsim-toolchain.xml ├── blackberry-toolchain.xml ├── common-defines.xml ├── cygwin-toolchain.xml ├── dospath.bat ├── emscripten-toolchain.xml ├── example.hxcpp_config.xml ├── finish-setup.xml ├── gcc-toolchain.xml ├── gcw0-toolchain.xml ├── gph-toolchain.xml ├── haxe-target.xml ├── iphoneos-toolchain.xml ├── iphonesim-toolchain.xml ├── linux-toolchain.xml ├── mac-toolchain.xml ├── mingw-toolchain.xml ├── msvc-arm64-setup.bat ├── msvc-setup.bat ├── msvc-toolchain.xml ├── msvc-winrt-setup.bat ├── msvc-winrt64-setup.bat ├── msvc64-setup.bat ├── nvcc-setup.xml ├── setup.xml ├── tizen-toolchain.xml ├── watchos-toolchain.xml ├── watchsimulator-toolchain.xml └── webos-toolchain.xml └── tools ├── azure-pipelines └── build.yml ├── build ├── Build.hx └── compile.hxml ├── haxe ├── build_linux.sh └── build_osx.sh ├── hxcpp ├── BuildTool.hx ├── CompileCache.hx ├── Compiler.hx ├── CopyFile.hx ├── File.hx ├── FileGroup.hx ├── HLSL.hx ├── Linker.hx ├── Log.hx ├── Manifester.hx ├── PathManager.hx ├── Prelinker.hx ├── ProcessManager.hx ├── Profile.hx ├── Setup.hx ├── Stripper.hx ├── Target.hx ├── ThreadPool.hx ├── Tools.hx ├── compile-cpp.hxml └── compile.hxml ├── run ├── RunMain.hx └── compile.hxml └── version └── Write.hx /.gitattributes: -------------------------------------------------------------------------------- 1 | project/thirdparty/*/** linguist-vendored 2 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: main 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | Windows32: 6 | strategy: 7 | fail-fast: false 8 | matrix: 9 | haxe: [ 4.3.4, latest ] 10 | uses: ./.github/workflows/test.yml 11 | name: Test Windows (32bit) 12 | with: 13 | haxe: ${{ matrix.haxe }} 14 | arch: 32 15 | sep: \ 16 | ext: .dll 17 | os: windows-latest 18 | 19 | Windows64: 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | haxe: [ 4.3.4, latest ] 24 | uses: ./.github/workflows/test.yml 25 | name: Test Windows (64bit) 26 | with: 27 | haxe: ${{ matrix.haxe }} 28 | arch: 64 29 | sep: \ 30 | ext: .dll 31 | os: windows-latest 32 | 33 | MacOS64: 34 | strategy: 35 | fail-fast: false 36 | matrix: 37 | haxe: [ 4.3.4, latest ] 38 | uses: ./.github/workflows/test.yml 39 | name: Test MacOS (x86_64) 40 | with: 41 | haxe: ${{ matrix.haxe }} 42 | arch: 64 43 | sep: / 44 | ext: .dylib 45 | os: macos-13 46 | 47 | MacOSArm: 48 | strategy: 49 | fail-fast: false 50 | matrix: 51 | haxe: [ 4.3.4, latest ] 52 | uses: ./.github/workflows/test.yml 53 | name: Test MacOS (Arm64) 54 | with: 55 | haxe: ${{ matrix.haxe }} 56 | arch: Arm64 57 | sep: / 58 | ext: .dylib 59 | os: macos-latest 60 | 61 | Linux32: 62 | strategy: 63 | fail-fast: false 64 | matrix: 65 | haxe: [ 4.3.4, latest ] 66 | uses: ./.github/workflows/test.yml 67 | name: Test Linux (32bit) 68 | with: 69 | haxe: ${{ matrix.haxe }} 70 | arch: 32 71 | sep: / 72 | ext: .dso 73 | os: ubuntu-latest 74 | 75 | Linux64: 76 | strategy: 77 | fail-fast: false 78 | matrix: 79 | haxe: [ 4.3.4, latest ] 80 | uses: ./.github/workflows/test.yml 81 | name: Test Linux (64bit) 82 | with: 83 | haxe: ${{ matrix.haxe }} 84 | arch: 64 85 | sep: / 86 | ext: .dso 87 | os: ubuntu-latest 88 | -------------------------------------------------------------------------------- /.github/workflows/setup/action.yml: -------------------------------------------------------------------------------- 1 | name: setup 2 | inputs: 3 | haxe: 4 | required: true 5 | type: string 6 | runs: 7 | using: composite 8 | steps: 9 | - name: install haxe 10 | uses: Aidan63/setup-haxe@3d3101bcd0a2001699fc8295f4d9eddd0724d3e9 11 | with: 12 | haxe-version: ${{ inputs.haxe }} 13 | 14 | - name: install haxe libraries 15 | shell: pwsh 16 | run: | 17 | haxelib git utest https://github.com/haxe-utest/utest 18 | haxelib git hx4compat https://github.com/HaxeFoundation/hx4compat 19 | haxelib dev hxcpp ${{ github.workspace }} 20 | haxelib list 21 | 22 | - name: install native libraries 23 | if: runner.os == 'Linux' 24 | shell: pwsh 25 | run: | 26 | sudo apt-get update -qqy 27 | sudo apt-get install -qqy gcc-multilib g++-multilib 28 | 29 | - name: build run.n 30 | working-directory: tools/run 31 | shell: pwsh 32 | run: haxe compile.hxml 33 | 34 | - name: build hxcpp 35 | working-directory: tools/hxcpp 36 | shell: pwsh 37 | run: haxe compile.hxml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | obj 2 | bin 3 | lib 4 | project/cppia_bin 5 | test/ndlls/cpp 6 | test/ndlls/cpp64 7 | test/std/arm32 8 | test/std/arm64 9 | test/std/cpp32 10 | test/std/cpp64 11 | test/std/mybase.db 12 | test/std/hxcpp.db 13 | test/opMatrix/Ops.hx 14 | test/opMatrix/cpp 15 | test/haxe/cpp 16 | test/telemetry/cpp 17 | test/extern-lib/gen-externs 18 | test/cffi/project/ndll 19 | test/snippets/messagebox/cpp 20 | test/haxe/gc/big.txt 21 | tools/hxcpp/cpp 22 | hxcpp.n 23 | .DS_Store 24 | 25 | *.swp 26 | *.exe 27 | *.pdb 28 | *.ilk 29 | 30 | .vscode 31 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | * Copyright (c) 2008 by the contributors 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following condition is met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * 9 | * See individual source files for additional license information. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE HAXE PROJECT CONTRIBUTORS ``AS IS'' AND ANY 12 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 13 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 14 | * DISCLAIMED. 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hxcpp 2 | 3 | [![Build Status](https://dev.azure.com/HaxeFoundation/GitHubPublic/_apis/build/status/HaxeFoundation.hxcpp?branchName=master)](https://dev.azure.com/HaxeFoundation/GitHubPublic/_build/latest?definitionId=3&branchName=master) 4 | 5 | hxcpp is the runtime support for the c++ backend of the [haxe](http://haxe.org/) compiler. This contains the headers, libraries and support code required to generate a fully compiled executable from haxe code. 6 | 7 | 8 | # building the tools 9 | 10 | ``` 11 | REPO=$(pwd) 12 | cd ${REPO}/tools/run 13 | haxe compile.hxml 14 | cd ${REPO}/tools/hxcpp 15 | haxe compile.hxml 16 | cd $REPO 17 | ``` 18 | 19 | # cppia 20 | 21 | You first need to build the cppia host. 22 | 23 | ``` 24 | REPO=$(pwd) 25 | cd ${REPO}/project 26 | haxe compile-cppia.hxml 27 | cd $REPO 28 | ``` 29 | 30 | Then you can do `haxelib run hxcpp file.cppia`. 31 | -------------------------------------------------------------------------------- /build-tool/BuildCommon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/build_xml/Stripper.md: -------------------------------------------------------------------------------- 1 | Stripper 2 | -------- 3 | 4 | A stripper is used to remove debug information in release builds on gcc-like systems. It may contain entries: 5 | 6 | - *exe* - Override stripper command 7 | ```xml 8 | 9 | ``` 10 | 11 | - *flag* - Add flag to stripper command 12 | ```xml 13 | 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /docs/build_xml/Tags.md: -------------------------------------------------------------------------------- 1 | Tags 2 | ---- 3 | 4 | Tags are identifiers that link compiler flags with specific files. Usually, they are defined in a files group with the 'tags' attribute as a comma separated list, and with the 'tag' attribute on a compiler 'flag' node. Files are then compiled with all the flags that have matching tags. 5 | 6 | By restricting tags to certain files, only a sub-set of files needs to be recompiled when conditions change, and files without the relevant tags can reuse their object files. This can save a lot of time, since some flags only apply to a few files. 7 | 8 | Files can override the group tags by specifying their own 'tags' attribute. Groups can add tags with the 'tag' node. 9 | 10 | Some tags have standard meanings when compiling haxe code: 11 | - *haxe* - The haxe tag adds all the required compiler flags to get haxe-generated code to compile correctly, and should be added to files that depend directly or indirectly on hxcpp.h. 12 | - *static* - This will add the STATIC_LINK define when appropriate, which is used for generating cffi glue. It should be added to cffi code that might generate static libraries. 13 | - *gc* - These flags only affect the garbage-collection files 14 | - *hxstring* - These flags only affect String.cpp 15 | - *optimization tags* - each file is assumed to have exactly 1 optimization tags. If none is explicitly specified, then the default is used depending on whether it is a debug or release build. They are: 16 | + optim-std = alias for 'debug' or 'release' depending on build 17 | + debug 18 | + release 19 | + optim-none 20 | + optim-size 21 | 22 | Setting one of these tags is useful for compiling your library in release mode, even if haxe has -debug. Some very big files are slow to compile in release mode, so using a less optimized mode can be faster. 23 | 24 | 25 | The tags attribute can be added to a haxe-generated file using the `@:fileXml` meta, eg: 26 | ```haxe 27 | @:fileXml("tags='haxe,optim-none'") 28 | class MyClass { ... 29 | ``` 30 | 31 | Here, the class is compiled with the normal haxe flags, but has the optimizations disabled, which can lead to much faster compiler times in some circumstances. 32 | -------------------------------------------------------------------------------- /docs/build_xml/XmlInjection.md: -------------------------------------------------------------------------------- 1 | Xml Injection 2 | ------------- 3 | 4 | When using external code in hxcpp, it is often useful to add libraries, include paths or compiler flags to the build process. This can be done with the `@:buildXml` class meta-data. eg, 5 | 6 | ```haxe 7 | @:buildXml(" 8 | 9 | 10 | 11 | ") 12 | @:keep 13 | class StaticNme 14 | { 15 | ... 16 | ``` 17 | 18 | So, by referencing a given class (you just 'import' the class, no need to use it because it has the @:keep meta-data), the xml fragment is also included. 19 | 20 | Here, the xml fragment is copied verbatim into the generated Build.xml immediately after the standard file lists. This example adds a library to the haxe target, but you could also add flags to files nodes, or files to another files node or target. Another possibility is to add an include command to pull in a whole external xml file. This can help avoid some syntax awkwardness needed when quoting strings in meta-data, and allows a normal xml editor to be used. 21 | 22 | It is also possible to replace the `__main__` file group to skip the standard initialization code and use a custom bootstrap procedure. 23 | 24 | -------------------------------------------------------------------------------- /docs/build_xml/example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hxcpp", 3 | "url": "https://github.com/HaxeFoundation/hxcpp/", 4 | "license": "BSD", 5 | "tags": ["haxe", "hxcpp", "cpp"], 6 | "description": "Hxcpp is the runtime support for the C++ backend of the Haxe compiler. This contains the headers, libraries and support code required to generate a fully compiled executable from Haxe code.", 7 | "version": "4.3.0", 8 | "releasenote": "See Changes.md", 9 | "contributors": ["gamehaxe", "HaxeFoundation"], 10 | "binaryversion": 48, 11 | "dependencies": { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /haxelib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hxcpp is the runtime support for the c++ backend of the haxe compiler. This release constains the headers, libraries and support code required to generate a fully compiled executable from haxe code. 4 | See Changes.txt 5 | 6 | -------------------------------------------------------------------------------- /hxcpp/NekoInit.hx: -------------------------------------------------------------------------------- 1 | package hxcpp; 2 | 3 | class NekoInit 4 | { 5 | public static function nekoInit(inModuleName:String) : Bool 6 | { 7 | var init = neko.Lib.load(inModuleName, "neko_init", 5); 8 | 9 | if (init != null) 10 | { 11 | init( function(s) return new String(s), 12 | function(len:Int) { var r = []; if (len > 0) r[len - 1] = null; return r; }, 13 | null, 14 | true, 15 | false); 16 | return true; 17 | 18 | } 19 | return false; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /include/hx/Boot.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_BOOT_H 2 | #define HX_BOOT_H 3 | 4 | // Properly construct all the classes defined in the haxe code 5 | void __boot_all(); 6 | 7 | namespace hx 8 | { 9 | 10 | // Initializer the hxcpp runtime system 11 | HXCPP_EXTERN_CLASS_ATTRIBUTES void Boot(); 12 | 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /include/hx/ErrorCodes.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_ERROR_CODES 2 | #define HX_ERROR_CODES 3 | 4 | // --- Exteral constants, used inline 5 | #define HX_INVALID_CAST Dynamic(HX_CSTRING("Invalid Cast")) 6 | #define HX_INVALID_INTERFACE Dynamic(HX_CSTRING("Object does not implement interface")) 7 | #define HX_INDEX_OUT_OF_BOUNDS Dynamic(HX_CSTRING("Index Out of Bounds")) 8 | #define HX_INVALID_CONSTRUCTOR Dynamic(HX_CSTRING("Invalid constructor")) 9 | #define HX_INVALID_ENUM_CONSTRUCTOR(_enum_name, _constructor_name) \ 10 | Dynamic(HX_CSTRING("Invalid enum constructor for ") + \ 11 | HX_CSTRING(_enum_name) + \ 12 | HX_CSTRING(": ") + \ 13 | _constructor_name) 14 | #define HX_INVALID_OBJECT Dynamic(HX_CSTRING("Invalid object")) 15 | #define HX_INVALID_ARG_COUNT Dynamic(HX_CSTRING("Invalid Arg Count")) 16 | #define HX_NULL_FUNCTION_POINTER Dynamic(HX_CSTRING("Null Function Pointer")) 17 | #define HX_INVALID_ENUM_ARG_COUNT(_enum_name, _constructor_name, _count, _expected) \ 18 | Dynamic(HX_CSTRING("Invalid enum arg count for ") + \ 19 | HX_CSTRING(_enum_name) + \ 20 | HX_CSTRING(".") + \ 21 | _constructor_name + \ 22 | HX_CSTRING(": expected ") + \ 23 | ::String(_expected) + \ 24 | HX_CSTRING(", got ") + \ 25 | ::String(_count)) 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/hx/Functions.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_FUNCTIONS_H 2 | #define HX_FUNCTIONS_H 3 | #include 4 | 5 | namespace hx 6 | { 7 | struct HXCPP_EXTERN_CLASS_ATTRIBUTES LocalFunc : public hx::Object 8 | { 9 | int __GetType() const { return vtFunction; } 10 | inline void DoMarkThis(hx::MarkContext *__inCtx) { } 11 | #ifdef HXCPP_VISIT_ALLOCS 12 | inline void DoVisitThis(hx::VisitContext *__inCtx) { } 13 | #endif 14 | }; 15 | 16 | struct HXCPP_EXTERN_CLASS_ATTRIBUTES LocalThisFunc : public LocalFunc 17 | { 18 | Dynamic __this; 19 | void __SetThis(Dynamic inThis) { __this = inThis; } 20 | inline void DoMarkThis(hx::MarkContext *__inCtx) { HX_MARK_MEMBER(__this); } 21 | #ifdef HXCPP_VISIT_ALLOCS 22 | inline void DoVisitThis(hx::VisitContext *__inCtx) { HX_VISIT_MEMBER(__this); } 23 | #endif 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/hx/HeaderVersion.h: -------------------------------------------------------------------------------- 1 | #ifndef HXCPP_HEADER_VERSION 2 | #define HXCPP_HEADER_VERSION 330 3 | #endif 4 | -------------------------------------------------------------------------------- /include/hx/IndexRef.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_INDEX_REF_H 2 | #define HX_INDEX_REF_H 3 | 4 | namespace hx 5 | { 6 | 7 | } 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/hx/Interface.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_INTERFACE_H 2 | #define HX_INTERFACE_H 3 | 4 | namespace hx 5 | { 6 | 7 | HXCPP_EXTERN_CLASS_ATTRIBUTES void InvalidInterface(); 8 | 9 | template 10 | inline T interface_cast(void *ptr) 11 | { 12 | #if defined(HXCPP_GC_CHECK_POINTER) || defined(HXCPP_DEBUG) 13 | if (!ptr) hx::InvalidInterface(); 14 | #endif 15 | return static_cast(ptr); 16 | } 17 | 18 | template 19 | inline T interface_check(T inObj,int interfaceId) 20 | { 21 | Dynamic d(inObj); 22 | if ( !d.mPtr || !d->_hx_getInterface(interfaceId)) 23 | hx::BadCast(); 24 | return inObj; 25 | } 26 | 27 | } 28 | 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /include/hx/MacrosJumbo.tpl: -------------------------------------------------------------------------------- 1 | #ifndef HX_MACROS_JUMBO_H 2 | #define HX_MACROS_JUMBO_H 3 | 4 | ::foreach LOCALS:: 5 | #define HX_BEGIN_LOCAL_FUNC_S::ARG::(SUPER,name,::TYPE_ARGS::) \ 6 | struct name : public SUPER { \ 7 | ::TYPE_DECL::; \ 8 | void __Mark(hx::MarkContext *__inCtx) { DoMarkThis(__inCtx); ::MARKS:: } \ 9 | void __Visit(hx::VisitContext *__inCtx) { DoVisitThis(__inCtx); ::VISITS:: } \ 10 | name(::CONSTRUCT_ARGS::) : ::CONSTRUCT_VARS:: {}::end:: 11 | 12 | #define HX_LOCAL_RUN _hx_run 13 | 14 | ::foreach LOCALS:: 15 | #define HX_END_LOCAL_FUNC::ARG::(ret) HX_DYNAMIC_CALL::ARG::(ret, HX_LOCAL_RUN ) };::end:: 16 | 17 | // For compatibility until next version of haxe is released 18 | ::foreach LOCALS:: 19 | #define HX_BEGIN_LOCAL_FUNC::ARG::(name,::TYPE_ARGS::) \ 20 | HX_BEGIN_LOCAL_FUNC_S::ARG::(hx::LocalFunc,name,::TYPE_ARGS::)::end:: 21 | 22 | 23 | #endif 24 | 25 | 26 | -------------------------------------------------------------------------------- /include/hx/Memory.h: -------------------------------------------------------------------------------- 1 | #ifdef HX_MEMORY_H_OVERRIDE 2 | // Users can define their own header to use here, but there is no API 3 | // compatibility gaurantee for future changes. 4 | #include HX_MEMORY_H_OVERRIDE 5 | 6 | // Todo - special version? 7 | inline void HxFreeGCBlock(void *p) { 8 | HxFree(p); 9 | } 10 | 11 | #else 12 | 13 | #ifndef HX_MEMORY_H 14 | #define HX_MEMORY_H 15 | 16 | #include 17 | 18 | inline void *HxAlloc(size_t size) { 19 | return malloc(size); 20 | } 21 | 22 | inline void HxFree(void *p) { 23 | free(p); 24 | } 25 | 26 | void *HxAllocGCBlock(size_t size); 27 | void HxFreeGCBlock(void *p); 28 | 29 | 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/hx/OS.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_OS_H 2 | #define HX_OS_H 3 | 4 | // OS FLAGS 5 | #if defined(_WIN32) 6 | # define NEKO_WINDOWS 7 | #endif 8 | 9 | #if defined(__APPLE__) || defined(__MACH__) || defined(macintosh) 10 | # define NEKO_MAC 11 | #endif 12 | 13 | #if defined(linux) || defined(__linux__) 14 | # define NEKO_LINUX 15 | #endif 16 | 17 | #if defined(__FreeBSD_kernel__) 18 | # define NEKO_GNUKBSD 19 | #endif 20 | 21 | #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 22 | # define NEKO_BSD 23 | #endif 24 | 25 | // COMPILER/PROCESSOR FLAGS 26 | #if defined(__GNUC__) 27 | # define NEKO_GCC 28 | #endif 29 | 30 | #if defined(_MSC_VER) 31 | # define NEKO_VCC 32 | #endif 33 | 34 | #if defined(__MINGW32__) 35 | # define NEKO_MINGW 36 | #endif 37 | 38 | #if defined(__i386__) || defined(_WIN32) 39 | # define NEKO_X86 40 | #endif 41 | 42 | #if defined(__ppc__) 43 | # define NEKO_PPC 44 | #endif 45 | 46 | #if defined(_64BITS) 47 | # define NEKO_64BITS 48 | #endif 49 | 50 | #if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_BSD) || defined(NEKO_GNUKBSD) 51 | # define NEKO_POSIX 52 | #endif 53 | 54 | #if defined(NEKO_GCC) 55 | # define NEKO_THREADED 56 | # define NEKO_DIRECT_THREADED 57 | #endif 58 | 59 | #include 60 | #ifndef NEKO_VCC 61 | # include 62 | #endif 63 | 64 | 65 | 66 | 67 | 68 | #undef EXPORT 69 | #undef IMPORT 70 | #if defined(NEKO_VCC) || defined(NEKO_MINGW) 71 | # define INLINE __inline 72 | # define EXPORT __declspec( dllexport ) 73 | # define IMPORT __declspec( dllimport ) 74 | #elif defined (HX_LINUX) 75 | # define INLINE inline 76 | # define EXPORT __attribute__ ((visibility("default"))) 77 | # define IMPORT 78 | #else 79 | # define INLINE inline 80 | # define EXPORT __attribute__ ((visibility("default"))) 81 | # define IMPORT 82 | #endif 83 | 84 | #ifdef NEKO_POSIX 85 | # include 86 | # define POSIX_LABEL(name) name: 87 | # define HANDLE_EINTR(label) if( errno == EINTR ) goto label 88 | # define HANDLE_FINTR(f,label) if( ferror(f) && errno == EINTR ) goto label 89 | #else 90 | # define POSIX_LABEL(name) 91 | # define HANDLE_EINTR(label) 92 | # define HANDLE_FINTR(f,label) 93 | #endif 94 | 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /include/hx/StdString.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_STD_STRING_INCLUDEDED 2 | #define HX_STD_STRING_INCLUDEDED 3 | 4 | #include 5 | 6 | namespace hx 7 | { 8 | class StdString : public std::string 9 | { 10 | public: 11 | StdString() : std::string() { } 12 | StdString(const char *inPtr) : std::string(inPtr) { } 13 | StdString(const char *inPtr, int inLen) : std::string(inPtr, inLen) { } 14 | StdString(const std::string &inS) : std::string(inS) { } 15 | StdString(const StdString &inS) : std::string(inS) { } 16 | 17 | #if (HXCPP_API_LEVEL>1) 18 | StdString(const Dynamic &inS) : std::string(inS.mPtr ? inS.mPtr->toString().utf8_str() : "null") { } 19 | StdString(const String &inS) : std::string(inS.utf8_str()) { } 20 | String toString() const { return String(c_str(),size()).dup(); } 21 | String toString() { return String(c_str(),size()).dup(); } 22 | operator Dynamic() const { return const_cast(this)->toString(); } 23 | #endif 24 | 25 | inline const StdString &toStdString() const { return *this; } 26 | 27 | }; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/hx/StringAlloc.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_STRING_ALLOC 2 | #define HX_STRING_ALLOC 3 | 4 | #include 5 | #include 6 | 7 | namespace hx 8 | { 9 | 10 | class IStringAlloc 11 | { 12 | public: 13 | virtual void *allocBytes(size_t inBytes) = 0; 14 | 15 | protected: 16 | ~IStringAlloc(){}; 17 | }; 18 | 19 | template 20 | class StringAlloc : public IStringAlloc 21 | { 22 | char buffer[STACK]; 23 | size_t alloced; 24 | char *heap; 25 | 26 | public: 27 | inline StringAlloc() : alloced(0), heap(0) { } 28 | ~StringAlloc() 29 | { 30 | if (heap) 31 | free(heap); 32 | } 33 | void *allocBytes(size_t inBytes) 34 | { 35 | if (inBytes<=STACK) 36 | return buffer; 37 | if (inBytes>alloced) 38 | { 39 | alloced = inBytes; 40 | heap = (char *)realloc(heap, alloced); 41 | } 42 | return heap; 43 | } 44 | private: 45 | StringAlloc(const StringAlloc &); 46 | void operator=(const StringAlloc &); 47 | }; 48 | 49 | typedef StringAlloc<100> strbuf; 50 | 51 | } // end namespace hx 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/hx/Telemetry.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_TELEMETRY_H 2 | #define HX_TELEMETRY_H 3 | 4 | #define HX_TELEMETRY_VERSION 1 5 | 6 | #include 7 | #include 8 | 9 | struct TelemetryFrame 10 | { 11 | // microseconds, always valid 12 | int gctime; 13 | int gcoverhead; 14 | 15 | // Valid only if profiler is enabled 16 | std::vector *samples; 17 | std::vector *names; 18 | 19 | // Valid only if allocations (and profiler) are enabled 20 | std::vector *allocation_data; 21 | std::vector *stacks; 22 | }; 23 | 24 | // --- Telemetry ----------------------------------------------------------------- 25 | 26 | int __hxcpp_hxt_start_telemetry(bool profiler, bool allocations); 27 | void __hxcpp_hxt_stash_telemetry(); 28 | TelemetryFrame* __hxcpp_hxt_dump_telemetry(int thread_num); 29 | void __hxcpp_hxt_ignore_allocs(int delta); 30 | 31 | // expose these from GCInternal 32 | int __hxcpp_gc_reserved_bytes(); 33 | int __hxcpp_gc_used_bytes(); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/hx/TelemetryTracy.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_TELEMETRY_TRACY_H 2 | #define HX_TELEMETRY_TRACY_H 3 | 4 | #ifndef HXCPP_TRACY 5 | #error "Error: HXCPP_TRACY must be defined." 6 | #endif 7 | 8 | #define TRACY_ENABLE 9 | #include 10 | #include "../../project/thirdparty/tracy-0.12.0/tracy/TracyC.h" 11 | #include "../../project/thirdparty/tracy-0.12.0/tracy/Tracy.hpp" 12 | 13 | #ifdef HXCPP_TRACY_MEMORY 14 | #ifdef HXCPP_GC_MOVING 15 | #error "Error: HXCPP_TRACY_MEMORY is not supported when HXCPP_GC_MOVING is active." 16 | #endif 17 | #ifdef HXCPP_GC_GENERATIONAL 18 | #error "Error: HXCPP_TRACY_MEMORY is not supported when HXCPP_GC_GENERATIONAL is active." 19 | #endif 20 | #endif 21 | 22 | #ifdef HXCPP_TRACY_INCLUDE_CALLSTACKS 23 | #define HXCPP_TRACY_ZONE(name) \ 24 | ::hx::strbuf TracyConcat(_hx_tracy_str_buffer, TracyLine); \ 25 | int TracyConcat(_hx_tracy_str_length, TracyLine); \ 26 | const char *TracyConcat(_hx_tracy_str_buffer_ptr, TracyLine) = name.utf8_str(&TracyConcat(_hx_tracy_str_buffer, TracyLine), false, &TracyConcat(_hx_tracy_str_length, TracyLine)); \ 27 | ::tracy::ScopedZone TracyConcat(_hx_tracy_scoped_zone,TracyLine)(_hx_stackframe.lineNumber, _hx_stackframe.position->fileName, strlen(_hx_stackframe.position->fileName), _hx_stackframe.position->fullName, strlen(_hx_stackframe.position->fullName), TracyConcat(_hx_tracy_str_buffer_ptr, TracyLine), TracyConcat(_hx_tracy_str_length, TracyLine), __hxcpp_tracy_get_zone_count()); 28 | #else 29 | #define HXCPP_TRACY_ZONE(name) \ 30 | ::hx::strbuf TracyConcat(_hx_tracy_str_buffer, TracyLine); \ 31 | int TracyConcat(_hx_tracy_str_length, TracyLine); \ 32 | const char *TracyConcat(_hx_tracy_str_buffer_ptr, TracyLine) = name.utf8_str(&TracyConcat(_hx_tracy_str_buffer, TracyLine), false, &TracyConcat(_hx_tracy_str_length, TracyLine)); \ 33 | ::tracy::ScopedZone TracyConcat(_hx_tracy_scoped_zone,TracyLine)(_hx_stackframe.lineNumber, _hx_stackframe.position->fileName, strlen(_hx_stackframe.position->fileName), _hx_stackframe.position->fullName, strlen(_hx_stackframe.position->fullName), TracyConcat(_hx_tracy_str_buffer_ptr, TracyLine), TracyConcat(_hx_tracy_str_length, TracyLine), -1); 34 | #endif 35 | 36 | void __hxcpp_tracy_framemark(); 37 | void __hxcpp_tracy_plot(::String name, ::Float val); 38 | void __hxcpp_tracy_plot_config(::String name, uint8_t format, bool step, bool fill, int color); 39 | void __hxcpp_tracy_message(::String msg, int color); 40 | void __hxcpp_tracy_message_app_info(::String info); 41 | void __hxcpp_tracy_set_thread_name_and_group(String name, int groupHint); 42 | int __hxcpp_tracy_get_zone_count(); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/hx/Undefine.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_UNDEFINE_H 2 | #define HX_UNDEFINE_H 3 | 4 | #undef TRUE 5 | #undef FALSE 6 | #undef BOOLEAN 7 | #undef ERROR 8 | #undef NO_ERROR 9 | #undef DELETE 10 | #undef OPTIONS 11 | #undef IN 12 | #undef OUT 13 | #undef ALTERNATE 14 | #undef OPTIONAL 15 | #undef DOUBLE_CLICK 16 | #undef DIFFERENCE 17 | #undef POINT 18 | #undef RECT 19 | #undef OVERFLOW 20 | #undef UNDERFLOW 21 | #undef DOMAIN 22 | #undef TRANSPARENT 23 | #undef CONST 24 | #undef CopyFile 25 | #undef COLOR_HIGHLIGHT 26 | #undef __valid 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/hx/Unordered.h: -------------------------------------------------------------------------------- 1 | #ifndef HX_UNORDERED_INCLUDED 2 | #define HX_UNORDERED_INCLUDED 3 | 4 | #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || ( defined(__GNUC__) && defined(HXCPP_CPP11) ) 5 | #include 6 | #include 7 | 8 | namespace hx 9 | { 10 | 11 | template 12 | struct UnorderedSet : public std::unordered_set { }; 13 | 14 | template 15 | struct UnorderedMap : public std::unordered_map { }; 16 | 17 | } 18 | 19 | 20 | #else 21 | 22 | #include 23 | #include 24 | 25 | namespace hx 26 | { 27 | 28 | template 29 | struct UnorderedSet : public std::set { }; 30 | 31 | template 32 | struct UnorderedMap : public std::map { }; 33 | 34 | } 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /java/org/haxe/HXCPP.java: -------------------------------------------------------------------------------- 1 | package org.haxe; 2 | 3 | // Wrapper for native library 4 | 5 | public class HXCPP { 6 | static boolean mInit = false; 7 | 8 | static public void run(String inClassName) { 9 | System.loadLibrary(inClassName); 10 | 11 | if (!mInit) 12 | { 13 | mInit = true; 14 | main(); 15 | } 16 | } 17 | 18 | public static native void main(); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /project/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
76 | 77 | 78 | 79 |
80 |
81 | 82 | 83 |
84 | -------------------------------------------------------------------------------- /project/compile-cppia-arm64.hxml: -------------------------------------------------------------------------------- 1 | -main cpp.cppia.Host 2 | -D scriptable 3 | -D dll_export= 4 | -dce no 5 | -cpp cppia_bin 6 | -D HXCPP_ARM64 7 | -D HXCPP_CATCH_SEGV 8 | -D hxcpp_smart_strings 9 | -D destination=../../bin/{BINDIR}/Cppia{EXESUFFIX} 10 | -------------------------------------------------------------------------------- /project/compile-cppia.hxml: -------------------------------------------------------------------------------- 1 | -main cpp.cppia.Host 2 | -D scriptable 3 | -D dll_export= 4 | -dce no 5 | -cpp cppia_bin 6 | -D HXCPP_M64 7 | -D HXCPP_CATCH_SEGV 8 | -D hxcpp_smart_strings 9 | -D destination=../../bin/{BINDIR}/Cppia{EXESUFFIX} 10 | -------------------------------------------------------------------------------- /project/thirdparty/config/mbedtls/include/mbedtls_config.h: -------------------------------------------------------------------------------- 1 | #ifdef HX_WINDOWS 2 | #define MBEDTLS_THREADING_ALT 3 | #endif 4 | #ifndef HX_WINDOWS 5 | #define MBEDTLS_THREADING_PTHREAD 6 | #endif 7 | 8 | #define MBEDTLS_THREADING_C 9 | -------------------------------------------------------------------------------- /project/thirdparty/config/mbedtls/include/threading_alt.h: -------------------------------------------------------------------------------- 1 | #define WIN32_LEAN_AND_MEAN 2 | #include 3 | 4 | typedef struct { 5 | CRITICAL_SECTION cs; 6 | char is_valid; 7 | } mbedtls_threading_mutex_t; 8 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/.gitattributes: -------------------------------------------------------------------------------- 1 | # Classify all '.function' files as C for syntax highlighting purposes 2 | *.function linguist-language=C 3 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/.gitignore: -------------------------------------------------------------------------------- 1 | # Random seed file created by test scripts and sample programs 2 | seedfile 3 | 4 | # CMake build artifacts: 5 | CMakeCache.txt 6 | CMakeFiles 7 | CTestTestfile.cmake 8 | cmake_install.cmake 9 | Testing 10 | # CMake generates *.dir/ folders for in-tree builds (used by MSVC projects), ignore all of those: 11 | *.dir/ 12 | # MSVC files generated by CMake: 13 | /*.sln 14 | /*.vcxproj 15 | /*.filters 16 | 17 | # Test coverage build artifacts: 18 | Coverage 19 | *.gcno 20 | *.gcda 21 | coverage-summary.txt 22 | 23 | # generated by scripts/memory.sh 24 | massif-* 25 | 26 | # Eclipse project files 27 | .cproject 28 | .project 29 | /.settings 30 | 31 | # MSVC build artifacts: 32 | *.exe 33 | *.pdb 34 | *.ilk 35 | *.lib 36 | 37 | # Python build artifacts: 38 | *.pyc 39 | 40 | # CMake generates *.dir/ folders for in-tree builds (used by MSVC projects), ignore all of those: 41 | *.dir/ 42 | 43 | # Microsoft CMake extension for Visual Studio Code generates a build directory by default 44 | /build/ 45 | 46 | # Visual Studio artifacts 47 | /visualc/VS2010/.localhistory/ 48 | /visualc/VS2010/.vs/ 49 | /visualc/VS2010/Debug/ 50 | /visualc/VS2010/Release/ 51 | /visualc/VS2010/*.vcxproj.filters 52 | /visualc/VS2010/*.vcxproj.user 53 | 54 | # Generated documentation: 55 | /apidoc 56 | 57 | # PSA Crypto compliance test repo, cloned by test_psa_compliance.py 58 | /psa-arch-tests 59 | 60 | # Editor navigation files: 61 | /GPATH 62 | /GRTAGS 63 | /GSYMS 64 | /GTAGS 65 | /TAGS 66 | /cscope*.out 67 | /tags 68 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/.globalrc: -------------------------------------------------------------------------------- 1 | default:\ 2 | :langmap=c\:.c.h.function:\ 3 | 4 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/.mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | mypy_path = scripts 3 | namespace_packages = True 4 | warn_unused_configs = True 5 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/BUGS.md: -------------------------------------------------------------------------------- 1 | ## Known issues 2 | 3 | Known issues in Mbed TLS are [tracked on GitHub](https://github.com/Mbed-TLS/mbedtls/issues). 4 | 5 | ## Reporting a bug 6 | 7 | If you think you've found a bug in Mbed TLS, please follow these steps: 8 | 9 | 1. Make sure you're using the latest version of a 10 | [maintained branch](BRANCHES.md): `master`, `development`, 11 | or a long-time support branch. 12 | 2. Check [GitHub](https://github.com/Mbed-TLS/mbedtls/issues) to see if 13 | your issue has already been reported. If not, … 14 | 3. If the issue is a security risk (for example: buffer overflow, 15 | data leak), please report it confidentially as described in 16 | [`SECURITY.md`](SECURITY.md). If not, … 17 | 4. Please [create an issue on on GitHub](https://github.com/Mbed-TLS/mbedtls/issues). 18 | 19 | Please do not use GitHub for support questions. If you want to know 20 | how to do something with Mbed TLS, please see [`SUPPORT.md`](SUPPORT.md) for available documentation and support channels. 21 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/DartConfiguration.tcl: -------------------------------------------------------------------------------- 1 | Site: localhost 2 | BuildName: mbed TLS-test 3 | CoverageCommand: /usr/bin/gcov 4 | MemoryCheckCommand: /usr/bin/valgrind 5 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/SECURITY.md: -------------------------------------------------------------------------------- 1 | ## Reporting Vulnerabilities 2 | 3 | If you think you have found an Mbed TLS security vulnerability, then please 4 | send an email to the security team at 5 | . 6 | 7 | ## Security Incident Handling Process 8 | 9 | Our security process is detailed in our 10 | [security 11 | center](https://developer.trustedfirmware.org/w/mbed-tls/security-center/). 12 | 13 | Its primary goal is to ensure fixes are ready to be deployed when the issue 14 | goes public. 15 | 16 | ## Maintained branches 17 | 18 | Only the maintained branches, as listed in [`BRANCHES.md`](BRANCHES.md), 19 | get security fixes. 20 | Users are urged to always use the latest version of a maintained branch. 21 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/SUPPORT.md: -------------------------------------------------------------------------------- 1 | ## Documentation 2 | 3 | Here are some useful sources of information about using Mbed TLS: 4 | 5 | - [ReadTheDocs](https://mbed-tls.readthedocs.io/); 6 | - API documentation, see the [Documentation section of the 7 | README](README.md#documentation); 8 | - the `docs` directory in the source tree; 9 | - the [Mbed TLS Knowledge Base](https://mbed-tls.readthedocs.io/en/latest/kb/); 10 | - the [Mbed TLS mailing-list 11 | archives](https://lists.trustedfirmware.org/archives/list/mbed-tls@lists.trustedfirmware.org/). 12 | 13 | ## Asking Questions 14 | 15 | If you can't find your answer in the above sources, please use the [Mbed TLS 16 | mailing list](https://lists.trustedfirmware.org/mailman3/lists/mbed-tls.lists.trustedfirmware.org). 17 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/dco.txt: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/include/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.sln 3 | *.vcxproj 4 | mbedtls/check_config 5 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) 2 | 3 | if(INSTALL_MBEDTLS_HEADERS) 4 | 5 | file(GLOB headers "mbedtls/*.h") 6 | file(GLOB psa_headers "psa/*.h") 7 | 8 | install(FILES ${headers} 9 | DESTINATION include/mbedtls 10 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) 11 | 12 | install(FILES ${psa_headers} 13 | DESTINATION include/psa 14 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) 15 | 16 | endif(INSTALL_MBEDTLS_HEADERS) 17 | 18 | # Make config.h available in an out-of-source build. ssl-opt.sh requires it. 19 | if (ENABLE_TESTING AND NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) 20 | link_to_source(mbedtls) 21 | link_to_source(psa) 22 | endif() 23 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/include/mbedtls/constant_time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Constant-time functions 3 | * 4 | * Copyright The Mbed TLS Contributors 5 | * SPDX-License-Identifier: Apache-2.0 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | * not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef MBEDTLS_CONSTANT_TIME_H 21 | #define MBEDTLS_CONSTANT_TIME_H 22 | 23 | #include 24 | 25 | 26 | /** Constant-time buffer comparison without branches. 27 | * 28 | * This is equivalent to the standard memcmp function, but is likely to be 29 | * compiled to code using bitwise operation rather than a branch. 30 | * 31 | * This function can be used to write constant-time code by replacing branches 32 | * with bit operations using masks. 33 | * 34 | * \param a Pointer to the first buffer. 35 | * \param b Pointer to the second buffer. 36 | * \param n The number of bytes to compare in the buffer. 37 | * 38 | * \return Zero if the content of the two buffer is the same, 39 | * otherwise non-zero. 40 | */ 41 | int mbedtls_ct_memcmp( const void *a, 42 | const void *b, 43 | size_t n ); 44 | 45 | #endif /* MBEDTLS_CONSTANT_TIME_H */ 46 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/include/mbedtls/havege.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file havege.h 3 | * 4 | * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion 5 | */ 6 | /* 7 | * Copyright The Mbed TLS Contributors 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | #ifndef MBEDTLS_HAVEGE_H 23 | #define MBEDTLS_HAVEGE_H 24 | 25 | #if !defined(MBEDTLS_CONFIG_FILE) 26 | #include "mbedtls/config.h" 27 | #else 28 | #include MBEDTLS_CONFIG_FILE 29 | #endif 30 | 31 | #include 32 | #include 33 | 34 | #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * \brief HAVEGE state structure 42 | */ 43 | typedef struct mbedtls_havege_state 44 | { 45 | uint32_t PT1, PT2, offset[2]; 46 | uint32_t pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; 47 | uint32_t WALK[8192]; 48 | } 49 | mbedtls_havege_state; 50 | 51 | /** 52 | * \brief HAVEGE initialization 53 | * 54 | * \param hs HAVEGE state to be initialized 55 | */ 56 | void mbedtls_havege_init( mbedtls_havege_state *hs ); 57 | 58 | /** 59 | * \brief Clear HAVEGE state 60 | * 61 | * \param hs HAVEGE state to be cleared 62 | */ 63 | void mbedtls_havege_free( mbedtls_havege_state *hs ); 64 | 65 | /** 66 | * \brief HAVEGE rand function 67 | * 68 | * \param p_rng A HAVEGE state 69 | * \param output Buffer to fill 70 | * \param len Length of buffer 71 | * 72 | * \return 0 73 | */ 74 | int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif /* havege.h */ 81 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/include/mbedtls/net.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file net.h 3 | * 4 | * \brief Deprecated header file that includes net_sockets.h 5 | * 6 | * \deprecated Superseded by mbedtls/net_sockets.h 7 | */ 8 | /* 9 | * Copyright The Mbed TLS Contributors 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | #if !defined(MBEDTLS_CONFIG_FILE) 25 | #include "mbedtls/config.h" 26 | #else 27 | #include MBEDTLS_CONFIG_FILE 28 | #endif 29 | 30 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) 31 | #include "mbedtls/net_sockets.h" 32 | #if defined(MBEDTLS_DEPRECATED_WARNING) 33 | #warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" 34 | #endif /* MBEDTLS_DEPRECATED_WARNING */ 35 | #endif /* !MBEDTLS_DEPRECATED_REMOVED */ 36 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/include/mbedtls/platform_time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file platform_time.h 3 | * 4 | * \brief mbed TLS Platform time abstraction 5 | */ 6 | /* 7 | * Copyright The Mbed TLS Contributors 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | #ifndef MBEDTLS_PLATFORM_TIME_H 23 | #define MBEDTLS_PLATFORM_TIME_H 24 | 25 | #if !defined(MBEDTLS_CONFIG_FILE) 26 | #include "mbedtls/config.h" 27 | #else 28 | #include MBEDTLS_CONFIG_FILE 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /* 36 | * The time_t datatype 37 | */ 38 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) 39 | typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t; 40 | #else 41 | /* For time_t */ 42 | #include 43 | typedef time_t mbedtls_time_t; 44 | #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ 45 | 46 | /* 47 | * The function pointers for time 48 | */ 49 | #if defined(MBEDTLS_PLATFORM_TIME_ALT) 50 | extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time ); 51 | 52 | /** 53 | * \brief Set your own time function pointer 54 | * 55 | * \param time_func the time function implementation 56 | * 57 | * \return 0 58 | */ 59 | int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) ); 60 | #else 61 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) 62 | #define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO 63 | #else 64 | #define mbedtls_time time 65 | #endif /* MBEDTLS_PLATFORM_TIME_MACRO */ 66 | #endif /* MBEDTLS_PLATFORM_TIME_ALT */ 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* platform_time.h */ 73 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/include/psa/crypto_driver_common.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file psa/crypto_driver_common.h 3 | * \brief Definitions for all PSA crypto drivers 4 | * 5 | * This file contains common definitions shared by all PSA crypto drivers. 6 | * Do not include it directly: instead, include the header file(s) for 7 | * the type(s) of driver that you are implementing. For example, if 8 | * you are writing a dynamically registered driver for a secure element, 9 | * include `psa/crypto_se_driver.h`. 10 | * 11 | * This file is part of the PSA Crypto Driver Model, containing functions for 12 | * driver developers to implement to enable hardware to be called in a 13 | * standardized way by a PSA Cryptographic API implementation. The functions 14 | * comprising the driver model, which driver authors implement, are not 15 | * intended to be called by application developers. 16 | */ 17 | 18 | /* 19 | * Copyright The Mbed TLS Contributors 20 | * SPDX-License-Identifier: Apache-2.0 21 | * 22 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 23 | * not use this file except in compliance with the License. 24 | * You may obtain a copy of the License at 25 | * 26 | * http://www.apache.org/licenses/LICENSE-2.0 27 | * 28 | * Unless required by applicable law or agreed to in writing, software 29 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 30 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 31 | * See the License for the specific language governing permissions and 32 | * limitations under the License. 33 | */ 34 | #ifndef PSA_CRYPTO_DRIVER_COMMON_H 35 | #define PSA_CRYPTO_DRIVER_COMMON_H 36 | 37 | #include 38 | #include 39 | 40 | /* Include type definitions (psa_status_t, psa_algorithm_t, 41 | * psa_key_type_t, etc.) and macros to build and analyze values 42 | * of these types. */ 43 | #include "crypto_types.h" 44 | #include "crypto_values.h" 45 | /* Include size definitions which are used to size some arrays in operation 46 | * structures. */ 47 | #include 48 | 49 | /** For encrypt-decrypt functions, whether the operation is an encryption 50 | * or a decryption. */ 51 | typedef enum { 52 | PSA_CRYPTO_DRIVER_DECRYPT, 53 | PSA_CRYPTO_DRIVER_ENCRYPT 54 | } psa_encrypt_or_decrypt_t; 55 | 56 | #endif /* PSA_CRYPTO_DRIVER_COMMON_H */ 57 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/library/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | libmbed* 3 | *.sln 4 | *.vcxproj 5 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/library/constant_time_invasive.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file constant_time_invasive.h 3 | * 4 | * \brief Constant-time module: interfaces for invasive testing only. 5 | * 6 | * The interfaces in this file are intended for testing purposes only. 7 | * They SHOULD NOT be made available in library integrations except when 8 | * building the library for testing. 9 | */ 10 | /* 11 | * Copyright The Mbed TLS Contributors 12 | * SPDX-License-Identifier: Apache-2.0 13 | * 14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 15 | * not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at 17 | * 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | #ifndef MBEDTLS_CONSTANT_TIME_INVASIVE_H 28 | #define MBEDTLS_CONSTANT_TIME_INVASIVE_H 29 | 30 | #include "common.h" 31 | 32 | #if defined(MBEDTLS_TEST_HOOKS) 33 | 34 | /** Turn a value into a mask: 35 | * - if \p low <= \p c <= \p high, 36 | * return the all-bits 1 mask, aka (unsigned) -1 37 | * - otherwise, return the all-bits 0 mask, aka 0 38 | * 39 | * \param low The value to analyze. 40 | * \param high The value to analyze. 41 | * \param c The value to analyze. 42 | * 43 | * \return All-bits-one if \p low <= \p c <= \p high, otherwise zero. 44 | */ 45 | unsigned char mbedtls_ct_uchar_mask_of_range( unsigned char low, 46 | unsigned char high, 47 | unsigned char c ); 48 | 49 | #endif /* MBEDTLS_TEST_HOOKS */ 50 | 51 | #endif /* MBEDTLS_CONSTANT_TIME_INVASIVE_H */ 52 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-2.28.2/library/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Version information 3 | * 4 | * Copyright The Mbed TLS Contributors 5 | * SPDX-License-Identifier: Apache-2.0 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | * not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include "common.h" 21 | 22 | #if defined(MBEDTLS_VERSION_C) 23 | 24 | #include "mbedtls/version.h" 25 | #include 26 | 27 | unsigned int mbedtls_version_get_number( void ) 28 | { 29 | return( MBEDTLS_VERSION_NUMBER ); 30 | } 31 | 32 | void mbedtls_version_get_string( char *string ) 33 | { 34 | memcpy( string, MBEDTLS_VERSION_STRING, 35 | sizeof( MBEDTLS_VERSION_STRING ) ); 36 | } 37 | 38 | void mbedtls_version_get_string_full( char *string ) 39 | { 40 | memcpy( string, MBEDTLS_VERSION_STRING_FULL, 41 | sizeof( MBEDTLS_VERSION_STRING_FULL ) ); 42 | } 43 | 44 | #endif /* MBEDTLS_VERSION_C */ 45 | -------------------------------------------------------------------------------- /project/thirdparty/mbedtls-flags.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/.bazelrc: -------------------------------------------------------------------------------- 1 | common --experimental_enable_bzlmod 2 | build --incompatible_enable_cc_toolchain_resolution 3 | build --incompatible_strict_action_env 4 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/.github/workflows/cifuzz.yml: -------------------------------------------------------------------------------- 1 | name: CIFuzz 2 | on: [pull_request] 3 | jobs: 4 | Fuzzing: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Build Fuzzers 8 | id: build 9 | uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master 10 | with: 11 | oss-fuzz-project-name: 'pcre2' 12 | dry-run: false 13 | - name: Run Fuzzers 14 | uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master 15 | with: 16 | oss-fuzz-project-name: 'pcre2' 17 | fuzz-seconds: 300 18 | dry-run: false 19 | - name: Upload Crash 20 | uses: actions/upload-artifact@v3 21 | if: failure() && steps.build.outcome == 'success' 22 | with: 23 | name: artifacts 24 | path: ./out/artifacts 25 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/.github/workflows/scorecards.yml: -------------------------------------------------------------------------------- 1 | name: Scorecards supply-chain security 2 | on: 3 | # Only the default branch is supported. 4 | branch_protection_rule: 5 | schedule: 6 | - cron: '23 17 * * 1' 7 | push: 8 | branches: [ master ] 9 | 10 | # Declare default permissions as read only. 11 | permissions: read-all 12 | 13 | jobs: 14 | analysis: 15 | name: Scorecards analysis 16 | runs-on: ubuntu-latest 17 | permissions: 18 | # Needed to upload the results to code-scanning dashboard. 19 | security-events: write 20 | actions: read 21 | contents: read 22 | 23 | steps: 24 | - name: "Checkout code" 25 | uses: actions/checkout@v3 26 | with: 27 | persist-credentials: false 28 | 29 | - name: "Run analysis" 30 | uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4 31 | with: 32 | results_file: results.sarif 33 | results_format: sarif 34 | # Read-only PAT token. To create it, 35 | # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. 36 | repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} 37 | # Publish the results to enable scorecard badges. For more details, see 38 | # https://github.com/ossf/scorecard-action#publishing-results. 39 | # For private repositories, `publish_results` will automatically be set to `false`, 40 | # regardless of the value entered here. 41 | publish_results: true 42 | 43 | # Upload the results as artifacts (optional). 44 | - name: "Upload artifact" 45 | uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1 46 | with: 47 | name: SARIF file 48 | path: results.sarif 49 | retention-days: 5 50 | 51 | # Upload the results to GitHub's code scanning dashboard. 52 | - name: "Upload to code-scanning" 53 | uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 54 | with: 55 | sarif_file: results.sarif 56 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/AUTHORS: -------------------------------------------------------------------------------- 1 | THE MAIN PCRE2 LIBRARY CODE 2 | --------------------------- 3 | 4 | Written by: Philip Hazel 5 | Email local part: Philip.Hazel 6 | Email domain: gmail.com 7 | 8 | Retired from University of Cambridge Computing Service, 9 | Cambridge, England. 10 | 11 | Copyright (c) 1997-2022 University of Cambridge 12 | All rights reserved 13 | 14 | 15 | PCRE2 JUST-IN-TIME COMPILATION SUPPORT 16 | -------------------------------------- 17 | 18 | Written by: Zoltan Herczeg 19 | Email local part: hzmester 20 | Emain domain: freemail.hu 21 | 22 | Copyright(c) 2010-2022 Zoltan Herczeg 23 | All rights reserved. 24 | 25 | 26 | STACK-LESS JUST-IN-TIME COMPILER 27 | -------------------------------- 28 | 29 | Written by: Zoltan Herczeg 30 | Email local part: hzmester 31 | Emain domain: freemail.hu 32 | 33 | Copyright(c) 2009-2022 Zoltan Herczeg 34 | All rights reserved. 35 | 36 | #### 37 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") 2 | load("@bazel_skylib//rules:copy_file.bzl", "copy_file") 3 | 4 | copy_file( 5 | name = "config_h_generic", 6 | src = "src/config.h.generic", 7 | out = "src/config.h", 8 | ) 9 | 10 | copy_file( 11 | name = "pcre2_h_generic", 12 | src = "src/pcre2.h.generic", 13 | out = "src/pcre2.h", 14 | ) 15 | 16 | copy_file( 17 | name = "pcre2_chartables_c", 18 | src = "src/pcre2_chartables.c.dist", 19 | out = "src/pcre2_chartables.c", 20 | ) 21 | 22 | cc_library( 23 | name = "pcre2", 24 | srcs = [ 25 | "src/pcre2_auto_possess.c", 26 | "src/pcre2_compile.c", 27 | "src/pcre2_config.c", 28 | "src/pcre2_context.c", 29 | "src/pcre2_convert.c", 30 | "src/pcre2_dfa_match.c", 31 | "src/pcre2_error.c", 32 | "src/pcre2_extuni.c", 33 | "src/pcre2_find_bracket.c", 34 | "src/pcre2_maketables.c", 35 | "src/pcre2_match.c", 36 | "src/pcre2_match_data.c", 37 | "src/pcre2_newline.c", 38 | "src/pcre2_ord2utf.c", 39 | "src/pcre2_pattern_info.c", 40 | "src/pcre2_script_run.c", 41 | "src/pcre2_serialize.c", 42 | "src/pcre2_string_utils.c", 43 | "src/pcre2_study.c", 44 | "src/pcre2_substitute.c", 45 | "src/pcre2_substring.c", 46 | "src/pcre2_tables.c", 47 | "src/pcre2_ucd.c", 48 | "src/pcre2_ucptables.c", 49 | "src/pcre2_valid_utf.c", 50 | "src/pcre2_xclass.c", 51 | ":pcre2_chartables_c", 52 | ], 53 | hdrs = glob(["src/*.h"]) + [ 54 | ":config_h_generic", 55 | ":pcre2_h_generic", 56 | ], 57 | defines = [ 58 | "HAVE_CONFIG_H", 59 | "PCRE2_CODE_UNIT_WIDTH=8", 60 | "PCRE2_STATIC", 61 | ], 62 | includes = ["src"], 63 | strip_include_prefix = "src", 64 | visibility = ["//visibility:public"], 65 | ) 66 | 67 | cc_binary( 68 | name = "pcre2demo", 69 | srcs = ["src/pcre2demo.c"], 70 | visibility = ["//visibility:public"], 71 | deps = [":pcre2"], 72 | ) 73 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/COPYING: -------------------------------------------------------------------------------- 1 | PCRE2 LICENCE 2 | 3 | Please see the file LICENCE in the PCRE2 distribution for licensing details. 4 | 5 | End 6 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/CheckMan: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | 3 | # A script to scan PCRE2's man pages to check for typos in the control 4 | # sequences. I use only a small set of the available repertoire, so it is 5 | # straightforward to check that nothing else has slipped in by mistake. This 6 | # script should be called in the doc directory. 7 | 8 | $yield = 0; 9 | 10 | while (scalar(@ARGV) > 0) 11 | { 12 | $line = 0; 13 | $file = shift @ARGV; 14 | 15 | open (IN, $file) || die "Failed to open $file\n"; 16 | 17 | while () 18 | { 19 | $count = 0; 20 | $line++; 21 | if (/^\s*$/) 22 | { 23 | printf "Empty line $line of $file\n"; 24 | $yield = 1; 25 | } 26 | elsif (/^\./) 27 | { 28 | if (!/^\.\s*$| 29 | ^\.B\s+\S| 30 | ^\.TH\s\S| 31 | ^\.SH\s\S| 32 | ^\.SS\s\S| 33 | ^\.TP(?:\s?\d+)?\s*$| 34 | ^\.SM\s*$| 35 | ^\.br\s*$| 36 | ^\.rs\s*$| 37 | ^\.sp\s*$| 38 | ^\.nf\s*$| 39 | ^\.fi\s*$| 40 | ^\.P\s*$| 41 | ^\.PP\s*$| 42 | ^\.\\"(?:\ HREF)?\s*$| 43 | ^\.\\"\sHTML\s\s*$| 44 | ^\.\\"\sHTML\s<\/a>\s*$| 45 | ^\.\\"\s<\/a>\s*$| 46 | ^\.\\"\sJOINSH\s*$| 47 | ^\.\\"\sJOIN\s*$/x 48 | ) 49 | { 50 | printf "Bad control line $line of $file\n"; 51 | $yield = 1; 52 | } 53 | } 54 | elsif (/\\[^ef]|\\f[^IBP]/) 55 | { 56 | printf "Bad backslash in line $line of $file\n"; 57 | $yield = 1; 58 | } 59 | while (/\\f[BI]/g) 60 | { 61 | $count++; 62 | } 63 | while (/\\fP/g) 64 | { 65 | $count--; 66 | } 67 | if ($count != 0) 68 | { 69 | printf "Mismatching formatting in line $line of $file\n"; 70 | $yield = 1; 71 | } 72 | } 73 | 74 | close(IN); 75 | } 76 | 77 | exit $yield; 78 | # End 79 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/Detrail: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # This is a script for removing trailing whitespace from lines in files that 4 | # are listed on the command line. 5 | 6 | # This subroutine does the work for one file. 7 | 8 | sub detrail { 9 | my($file) = $_[0]; 10 | my($changed) = 0; 11 | open(IN, "$file") || die "Can't open $file for input"; 12 | @lines = ; 13 | close(IN); 14 | foreach (@lines) 15 | { 16 | if (/\s+\n$/) 17 | { 18 | s/\s+\n$/\n/; 19 | $changed = 1; 20 | } 21 | } 22 | if ($changed) 23 | { 24 | open(OUT, ">$file") || die "Can't open $file for output"; 25 | print OUT @lines; 26 | close(OUT); 27 | } 28 | } 29 | 30 | # This is the main program 31 | 32 | $, = ""; # Output field separator 33 | for ($i = 0; $i < @ARGV; $i++) { &detrail($ARGV[$i]); } 34 | 35 | # End 36 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/MODULE.bazel: -------------------------------------------------------------------------------- 1 | module( 2 | name = "pcre2", 3 | version = "10.40", 4 | compatibility_level = 1, 5 | ) 6 | 7 | bazel_dep(name = "rules_cc", version = "0.0.1") 8 | bazel_dep(name = "bazel_skylib", version = "1.2.1") 9 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/README.md: -------------------------------------------------------------------------------- 1 | # PCRE2 - Perl-Compatible Regular Expressions 2 | 3 | The PCRE2 library is a set of C functions that implement regular expression 4 | pattern matching using the same syntax and semantics as Perl 5. PCRE2 has its 5 | own native API, as well as a set of wrapper functions that correspond to the 6 | POSIX regular expression API. The PCRE2 library is free, even for building 7 | proprietary software. It comes in three forms, for processing 8-bit, 16-bit, 8 | or 32-bit code units, in either literal or UTF encoding. 9 | 10 | PCRE2 was first released in 2015 to replace the API in the original PCRE 11 | library, which is now obsolete and no longer maintained. As well as a more 12 | flexible API, the code of PCRE2 has been much improved since the fork. 13 | 14 | ## Download 15 | 16 | As well as downloading from the 17 | [GitHub site](https://github.com/PCRE2Project/pcre2), you can download PCRE2 18 | or the older, unmaintained PCRE1 library from an 19 | [*unofficial* mirror](https://sourceforge.net/projects/pcre/files/) at SourceForge. 20 | 21 | You can check out the PCRE2 source code via Git or Subversion: 22 | 23 | git clone https://github.com/PCRE2Project/pcre2.git 24 | svn co https://github.com/PCRE2Project/pcre2.git 25 | 26 | ## Contributed Ports 27 | 28 | If you just need the command-line PCRE2 tools on Windows, precompiled binary 29 | versions are available at this 30 | [Rexegg page](http://www.rexegg.com/pcregrep-pcretest.html). 31 | 32 | A PCRE2 port for z/OS, a mainframe operating system which uses EBCDIC as its 33 | default character encoding, can be found at 34 | [http://www.cbttape.org](http://www.cbttape.org/) (File 939). 35 | 36 | ## Documentation 37 | 38 | You can read the PCRE2 documentation 39 | [here](https://PCRE2Project.github.io/pcre2/doc/html/index.html). 40 | 41 | Comparisons to Perl's regular expression semantics can be found in the 42 | community authored Wikipedia entry for PCRE. 43 | 44 | There is a curated summary of changes for each PCRE release, copies of 45 | documentation from older releases, and other useful information from the third 46 | party authored 47 | [RexEgg PCRE Documentation and Change Log page](http://www.rexegg.com/pcre-documentation.html). 48 | 49 | ## Contact 50 | 51 | To report a problem with the PCRE2 library, or to make a feature request, please 52 | use the PCRE2 GitHub issues tracker. There is a mailing list for discussion of 53 | PCRE2 issues and development at pcre2-dev@googlegroups.com, which is where any 54 | announcements will be made. You can browse the 55 | [list archives](https://groups.google.com/g/pcre2-dev). 56 | 57 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/WORKSPACE.bazel: -------------------------------------------------------------------------------- 1 | # See MODULE.bazel 2 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Running aclocal here first (as happened for a while) caused the macros that 4 | # libtoolize puts in the m4 directory to be newer than the aclocal.m4 file that 5 | # aclocal creates. This meant that the next "make" cause aclocal to be run 6 | # again. Moving aclocal to after libtoolize does not seem to cause any 7 | # problems, and it fixes this issue. 8 | 9 | # GNU libtool is named differently on some systems. This code tries several 10 | # variants like glibtoolize (MacOSX) and libtoolize1x (FreeBSD) 11 | 12 | set +ex 13 | echo "Looking for a version of libtoolize (which can have different names)..." 14 | libtoolize="" 15 | for l in glibtoolize libtoolize15 libtoolize14 libtoolize ; do 16 | $l --version > /dev/null 2>&1 17 | if [ $? = 0 ]; then 18 | libtoolize=$l 19 | echo "Found $l" 20 | break 21 | fi 22 | echo "Did not find $l" 23 | done 24 | 25 | if [ "x$libtoolize" = "x" ]; then 26 | echo "Can't find libtoolize on your system" 27 | exit 1 28 | fi 29 | 30 | set -ex 31 | $libtoolize -c -f 32 | rm -rf autom4te.cache Makefile.in aclocal.m4 33 | aclocal --force -I m4 34 | autoconf -f -W all,no-obsolete 35 | autoheader -f -W all 36 | 37 | # Added no-portability to suppress automake 1.12's warning about the use 38 | # of recursive variables. 39 | 40 | automake -a -c -f -W all,no-portability 41 | 42 | rm -rf autom4te.cache 43 | exit 0 44 | 45 | # end autogen.sh 46 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/cmake/COPYING-CMAKE-SCRIPTS: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions 3 | are met: 4 | 5 | 1. Redistributions of source code must retain the copyright 6 | notice, this list of conditions and the following disclaimer. 7 | 2. Redistributions in binary form must reproduce the copyright 8 | notice, this list of conditions and the following disclaimer in the 9 | documentation and/or other materials provided with the distribution. 10 | 3. The name of the author may not be used to endorse or promote products 11 | derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/cmake/FindEditline.cmake: -------------------------------------------------------------------------------- 1 | # Modified from FindReadline.cmake (PH Feb 2012) 2 | 3 | if(EDITLINE_INCLUDE_DIR AND EDITLINE_LIBRARY) 4 | set(EDITLINE_FOUND TRUE) 5 | else(EDITLINE_INCLUDE_DIR AND EDITLINE_LIBRARY) 6 | FIND_PATH(EDITLINE_INCLUDE_DIR readline.h PATH_SUFFIXES 7 | editline 8 | edit/readline 9 | ) 10 | 11 | FIND_LIBRARY(EDITLINE_LIBRARY NAMES edit) 12 | include(FindPackageHandleStandardArgs) 13 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Editline DEFAULT_MSG EDITLINE_INCLUDE_DIR EDITLINE_LIBRARY) 14 | 15 | MARK_AS_ADVANCED(EDITLINE_INCLUDE_DIR EDITLINE_LIBRARY) 16 | endif(EDITLINE_INCLUDE_DIR AND EDITLINE_LIBRARY) 17 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/cmake/FindReadline.cmake: -------------------------------------------------------------------------------- 1 | # from http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/FindReadline.cmake 2 | # http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/COPYING-CMAKE-SCRIPTS 3 | # --> BSD licensed 4 | # 5 | # GNU Readline library finder 6 | if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY) 7 | set(READLINE_FOUND TRUE) 8 | else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY) 9 | FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h 10 | /usr/include/readline 11 | ) 12 | 13 | # 2008-04-22 The next clause used to read like this: 14 | # 15 | # FIND_LIBRARY(READLINE_LIBRARY NAMES readline) 16 | # FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses ) 17 | # include(FindPackageHandleStandardArgs) 18 | # FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY ) 19 | # 20 | # I was advised to modify it such that it will find an ncurses library if 21 | # required, but not if one was explicitly given, that is, it allows the 22 | # default to be overridden. PH 23 | 24 | FIND_LIBRARY(READLINE_LIBRARY NAMES readline) 25 | include(FindPackageHandleStandardArgs) 26 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY ) 27 | 28 | MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY) 29 | endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY) 30 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/cmake/pcre2-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION_MAJOR @PCRE2_MAJOR@) 2 | set(PACKAGE_VERSION_MINOR @PCRE2_MINOR@) 3 | set(PACKAGE_VERSION_PATCH 0) 4 | set(PACKAGE_VERSION @PCRE2_MAJOR@.@PCRE2_MINOR@.0) 5 | 6 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 7 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION OR 8 | PACKAGE_VERSION_MAJOR GREATER PACKAGE_FIND_VERSION_MAJOR) 9 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 10 | else() 11 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 12 | if(PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) 13 | set(PACKAGE_VERSION_EXACT TRUE) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/config-cmake.h.in: -------------------------------------------------------------------------------- 1 | /* config.h for CMake builds */ 2 | 3 | #cmakedefine HAVE_ATTRIBUTE_UNINITIALIZED 1 4 | #cmakedefine HAVE_DIRENT_H 1 5 | #cmakedefine HAVE_STRERROR 1 6 | #cmakedefine HAVE_SYS_STAT_H 1 7 | #cmakedefine HAVE_SYS_TYPES_H 1 8 | #cmakedefine HAVE_UNISTD_H 1 9 | #cmakedefine HAVE_WINDOWS_H 1 10 | 11 | #cmakedefine HAVE_BCOPY 1 12 | #cmakedefine HAVE_MEMFD_CREATE 1 13 | #cmakedefine HAVE_MEMMOVE 1 14 | #cmakedefine HAVE_SECURE_GETENV 1 15 | #cmakedefine HAVE_STRERROR 1 16 | 17 | #cmakedefine SUPPORT_PCRE2_8 1 18 | #cmakedefine SUPPORT_PCRE2_16 1 19 | #cmakedefine SUPPORT_PCRE2_32 1 20 | #cmakedefine PCRE2_DEBUG 1 21 | #cmakedefine DISABLE_PERCENT_ZT 1 22 | 23 | #cmakedefine SUPPORT_LIBBZ2 1 24 | #cmakedefine SUPPORT_LIBEDIT 1 25 | #cmakedefine SUPPORT_LIBREADLINE 1 26 | #cmakedefine SUPPORT_LIBZ 1 27 | 28 | #cmakedefine SUPPORT_JIT 1 29 | #cmakedefine SLJIT_PROT_EXECUTABLE_ALLOCATOR 1 30 | #cmakedefine SUPPORT_PCRE2GREP_JIT 1 31 | #cmakedefine SUPPORT_PCRE2GREP_CALLOUT 1 32 | #cmakedefine SUPPORT_PCRE2GREP_CALLOUT_FORK 1 33 | #cmakedefine SUPPORT_UNICODE 1 34 | #cmakedefine SUPPORT_VALGRIND 1 35 | 36 | #cmakedefine BSR_ANYCRLF 1 37 | #cmakedefine EBCDIC 1 38 | #cmakedefine EBCDIC_NL25 1 39 | #cmakedefine HEAP_MATCH_RECURSE 1 40 | #cmakedefine NEVER_BACKSLASH_C 1 41 | 42 | #define LINK_SIZE @PCRE2_LINK_SIZE@ 43 | #define HEAP_LIMIT @PCRE2_HEAP_LIMIT@ 44 | #define MATCH_LIMIT @PCRE2_MATCH_LIMIT@ 45 | #define MATCH_LIMIT_DEPTH @PCRE2_MATCH_LIMIT_DEPTH@ 46 | #define NEWLINE_DEFAULT @NEWLINE_DEFAULT@ 47 | #define PARENS_NEST_LIMIT @PCRE2_PARENS_NEST_LIMIT@ 48 | #define PCRE2GREP_BUFSIZE @PCRE2GREP_BUFSIZE@ 49 | #define PCRE2GREP_MAX_BUFSIZE @PCRE2GREP_MAX_BUFSIZE@ 50 | 51 | #define MAX_NAME_SIZE 32 52 | #define MAX_NAME_COUNT 10000 53 | 54 | /* end config.h for CMake builds */ 55 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/libpcre2-16.pc.in: -------------------------------------------------------------------------------- 1 | # Package Information for pkg-config 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: libpcre2-16 9 | Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support 10 | Version: @PACKAGE_VERSION@ 11 | Libs: -L${libdir} -lpcre2-16@LIB_POSTFIX@ 12 | Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ 13 | Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ 14 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/libpcre2-32.pc.in: -------------------------------------------------------------------------------- 1 | # Package Information for pkg-config 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: libpcre2-32 9 | Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support 10 | Version: @PACKAGE_VERSION@ 11 | Libs: -L${libdir} -lpcre2-32@LIB_POSTFIX@ 12 | Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ 13 | Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ 14 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/libpcre2-8.pc.in: -------------------------------------------------------------------------------- 1 | # Package Information for pkg-config 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: libpcre2-8 9 | Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support 10 | Version: @PACKAGE_VERSION@ 11 | Libs: -L${libdir} -lpcre2-8@LIB_POSTFIX@ 12 | Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ 13 | Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ 14 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/libpcre2-posix.pc.in: -------------------------------------------------------------------------------- 1 | # Package Information for pkg-config 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: libpcre2-posix 9 | Description: Posix compatible interface to libpcre2-8 10 | Version: @PACKAGE_VERSION@ 11 | Libs: -L${libdir} -lpcre2-posix@LIB_POSTFIX@ 12 | Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ 13 | Requires.private: libpcre2-8 14 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/maint/ucptestdata/testinput1: -------------------------------------------------------------------------------- 1 | findprop 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2 | findprop 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 3 | findprop 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 4 | findprop 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 5 | findprop 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 6 | findprop 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 7 | findprop 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 8 | findprop 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 9 | 10 | findprop 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 11 | findprop 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f 12 | findprop a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af 13 | findprop b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf 14 | findprop c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf 15 | findprop d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df 16 | findprop e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef 17 | findprop f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff 18 | 19 | findprop 0100 0101 0102 0103 0104 0105 0106 20 | 21 | findprop ffe0 ffe1 ffe2 ffe3 ffe4 ffe5 ffe6 ffe7 22 | findprop ffe8 ffe9 ffea ffeb ffec ffed ffee ffef 23 | findprop fff8 fff9 fffa fffb fffc fffd fffe ffff 24 | findprop 10000 10001 e01ef f0000 100000 25 | 26 | findprop 1b00 12000 7c0 a840 10900 27 | findprop 1d79 a77d 28 | 29 | findprop 0800 083e a4d0 a4f7 aa80 aadf 30 | findprop 10b00 10b35 13000 1342e 10840 10855 31 | 32 | findprop 11100 1113c 11680 116c0 33 | 34 | findprop 0d 0a 0e 0711 1b04 1111 1169 11fe ae4c ad89 35 | 36 | findprop 118a0 11ac7 16ad0 37 | 38 | findprop 11700 14400 108e0 11280 1d800 39 | 40 | findprop 11800 1e903 11da9 10d27 11ee0 16e48 10f27 10f30 41 | 42 | findprop a836 a833 1cf4 20f0 1cd0 43 | 44 | findprop 32ff 45 | 46 | findprop 1f16d 47 | 48 | findprop U+10e93 U+10eaa 49 | 50 | findprop 0602 202a 202b 202c 2068 2069 202d 202e 2067 51 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/maint/ucptestdata/testinput2: -------------------------------------------------------------------------------- 1 | find script Han 2 | find type Pe script Common scriptx Hangul 3 | find type Sk 4 | find type Pd 5 | find gbreak LVT 6 | find script Old_Uyghur 7 | find bidi PDF 8 | find bidi CS 9 | find bidi CS type Sm 10 | find bidi B 11 | find bidi FSI 12 | find bidi PDI 13 | find bidi RLI 14 | find bidi RLO 15 | find bidi S 16 | find bidi WS 17 | find script bopo 18 | find bool prependedconcatenationmark 19 | find bool pcm 20 | -------------------------------------------------------------------------------- /project/thirdparty/pcre2-10.42/pcre2_fuzzer.dict: -------------------------------------------------------------------------------- 1 | # This is attempt at a fuzzer dictionary for PCRE2. 2 | 3 | "\\A" 4 | "\\b" 5 | "\\B" 6 | "\\d" 7 | "\\D" 8 | "\\h" 9 | "\\H" 10 | "\\n" 11 | "\\N" 12 | "\\s" 13 | "\\S" 14 | "\\w" 15 | "\\W" 16 | "\\z" 17 | "\\Z" 18 | 19 | "(?" 20 | "(?:" 21 | "(?>" 22 | "(?=" 23 | "(?!" 24 | "(?<=" 25 | "(? 6 | 7 | #include "../common/TracyForceInline.hpp" 8 | #include "../common/TracyYield.hpp" 9 | 10 | namespace tracy 11 | { 12 | 13 | extern thread_local bool RpThreadInitDone; 14 | extern std::atomic RpInitDone; 15 | extern std::atomic RpInitLock; 16 | 17 | tracy_no_inline static void InitRpmallocPlumbing() 18 | { 19 | const auto done = RpInitDone.load( std::memory_order_acquire ); 20 | if( !done ) 21 | { 22 | int expected = 0; 23 | while( !RpInitLock.compare_exchange_weak( expected, 1, std::memory_order_release, std::memory_order_relaxed ) ) { expected = 0; YieldThread(); } 24 | const auto done = RpInitDone.load( std::memory_order_acquire ); 25 | if( !done ) 26 | { 27 | rpmalloc_initialize(); 28 | RpInitDone.store( 1, std::memory_order_release ); 29 | } 30 | RpInitLock.store( 0, std::memory_order_release ); 31 | } 32 | rpmalloc_thread_initialize(); 33 | RpThreadInitDone = true; 34 | } 35 | 36 | TRACY_API void InitRpmalloc() 37 | { 38 | if( !RpThreadInitDone ) InitRpmallocPlumbing(); 39 | } 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyCallstack.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYCALLSTACK_H__ 2 | #define __TRACYCALLSTACK_H__ 3 | 4 | #ifndef TRACY_NO_CALLSTACK 5 | 6 | # if !defined _WIN32 7 | # include 8 | # endif 9 | 10 | # if defined _WIN32 11 | # include "../common/TracyUwp.hpp" 12 | # ifndef TRACY_UWP 13 | # define TRACY_HAS_CALLSTACK 1 14 | # endif 15 | # elif defined __ANDROID__ 16 | # if !defined __arm__ || __ANDROID_API__ >= 21 17 | # define TRACY_HAS_CALLSTACK 2 18 | # else 19 | # define TRACY_HAS_CALLSTACK 5 20 | # endif 21 | # elif defined __linux 22 | # if defined _GNU_SOURCE && defined __GLIBC__ 23 | # define TRACY_HAS_CALLSTACK 3 24 | # else 25 | # define TRACY_HAS_CALLSTACK 2 26 | # endif 27 | # elif defined __APPLE__ 28 | # define TRACY_HAS_CALLSTACK 4 29 | # elif defined BSD 30 | # define TRACY_HAS_CALLSTACK 6 31 | # endif 32 | 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyCpuid.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYCPUID_HPP__ 2 | #define __TRACYCPUID_HPP__ 3 | 4 | // Prior to GCC 11 the cpuid.h header did not have any include guards and thus 5 | // including it more than once would cause a compiler error due to symbol 6 | // redefinitions. In order to support older GCC versions, we have to wrap this 7 | // include between custom include guards to prevent this issue. 8 | // See also https://github.com/wolfpld/tracy/issues/452 9 | 10 | #include 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyDebug.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYPRINT_HPP__ 2 | #define __TRACYPRINT_HPP__ 3 | 4 | #ifdef TRACY_VERBOSE 5 | # include 6 | # define TracyDebug(...) fprintf( stderr, __VA_ARGS__ ); 7 | #else 8 | # define TracyDebug(...) 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyDxt1.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYDXT1_HPP__ 2 | #define __TRACYDXT1_HPP__ 3 | 4 | namespace tracy 5 | { 6 | 7 | void CompressImageDxt1( const char* src, char* dst, int w, int h ); 8 | 9 | } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyKCore.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYKCORE_HPP__ 2 | #define __TRACYKCORE_HPP__ 3 | 4 | #ifdef __linux__ 5 | 6 | #include 7 | 8 | #include "TracyFastVector.hpp" 9 | 10 | namespace tracy 11 | { 12 | 13 | class KCore 14 | { 15 | struct Offset 16 | { 17 | uint64_t start; 18 | uint64_t size; 19 | uint64_t offset; 20 | }; 21 | 22 | public: 23 | KCore(); 24 | ~KCore(); 25 | 26 | void* Retrieve( uint64_t addr, uint64_t size ) const; 27 | 28 | private: 29 | int m_fd; 30 | FastVector m_offsets; 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyOverride.cpp: -------------------------------------------------------------------------------- 1 | #ifdef TRACY_ENABLE 2 | # ifdef __linux__ 3 | # include "TracyDebug.hpp" 4 | # ifdef TRACY_VERBOSE 5 | # include 6 | # include 7 | # endif 8 | 9 | extern "C" int dlclose( void* hnd ) 10 | { 11 | #ifdef TRACY_VERBOSE 12 | struct link_map* lm; 13 | if( dlinfo( hnd, RTLD_DI_LINKMAP, &lm ) == 0 ) 14 | { 15 | TracyDebug( "Overriding dlclose for %s\n", lm->l_name ); 16 | } 17 | else 18 | { 19 | TracyDebug( "Overriding dlclose for unknown object (%s)\n", dlerror() ); 20 | } 21 | #endif 22 | return 0; 23 | } 24 | 25 | # endif 26 | #endif 27 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyStringHelpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSTRINGHELPERS_HPP__ 2 | #define __TRACYSTRINGHELPERS_HPP__ 3 | 4 | #include 5 | #include 6 | 7 | #include "../common/TracyAlloc.hpp" 8 | #include "../common/TracyForceInline.hpp" 9 | 10 | namespace tracy 11 | { 12 | 13 | static tracy_force_inline char* CopyString( const char* src, size_t sz ) 14 | { 15 | auto dst = (char*)tracy_malloc( sz + 1 ); 16 | memcpy( dst, src, sz ); 17 | dst[sz] = '\0'; 18 | return dst; 19 | } 20 | 21 | static tracy_force_inline char* CopyString( const char* src ) 22 | { 23 | return CopyString( src, strlen( src ) ); 24 | } 25 | 26 | static tracy_force_inline char* CopyStringFast( const char* src, size_t sz ) 27 | { 28 | auto dst = (char*)tracy_malloc_fast( sz + 1 ); 29 | memcpy( dst, src, sz ); 30 | dst[sz] = '\0'; 31 | return dst; 32 | } 33 | 34 | static tracy_force_inline char* CopyStringFast( const char* src ) 35 | { 36 | return CopyStringFast( src, strlen( src ) ); 37 | } 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracySysPower.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSYSPOWER_HPP__ 2 | #define __TRACYSYSPOWER_HPP__ 3 | 4 | #if defined __linux__ 5 | # define TRACY_HAS_SYSPOWER 6 | #endif 7 | 8 | #ifdef TRACY_HAS_SYSPOWER 9 | 10 | #include 11 | #include 12 | 13 | #include "TracyFastVector.hpp" 14 | 15 | namespace tracy 16 | { 17 | 18 | class SysPower 19 | { 20 | struct Domain 21 | { 22 | uint64_t value; 23 | uint64_t overflow; 24 | FILE* handle; 25 | const char* name; 26 | }; 27 | 28 | public: 29 | SysPower(); 30 | ~SysPower(); 31 | 32 | void Tick(); 33 | 34 | private: 35 | void ScanDirectory( const char* path, int parent ); 36 | 37 | FastVector m_domains; 38 | uint64_t m_lastTime; 39 | }; 40 | 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracySysTime.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSYSTIME_HPP__ 2 | #define __TRACYSYSTIME_HPP__ 3 | 4 | #if defined _WIN32 || defined __linux__ || defined __APPLE__ 5 | # define TRACY_HAS_SYSTIME 6 | #else 7 | # include 8 | #endif 9 | 10 | #ifdef BSD 11 | # define TRACY_HAS_SYSTIME 12 | #endif 13 | 14 | #ifdef TRACY_HAS_SYSTIME 15 | 16 | #include 17 | 18 | namespace tracy 19 | { 20 | 21 | class SysTime 22 | { 23 | public: 24 | SysTime(); 25 | float Get(); 26 | 27 | void ReadTimes(); 28 | 29 | private: 30 | uint64_t idle, used; 31 | }; 32 | 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracySysTrace.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSYSTRACE_HPP__ 2 | #define __TRACYSYSTRACE_HPP__ 3 | 4 | #if !defined TRACY_NO_SYSTEM_TRACING && ( defined _WIN32 || defined __linux__ ) 5 | # include "../common/TracyUwp.hpp" 6 | # ifndef TRACY_UWP 7 | # define TRACY_HAS_SYSTEM_TRACING 8 | # endif 9 | #endif 10 | 11 | #ifdef TRACY_HAS_SYSTEM_TRACING 12 | 13 | #include 14 | 15 | namespace tracy 16 | { 17 | 18 | bool SysTraceStart( int64_t& samplingPeriod ); 19 | void SysTraceStop(); 20 | void SysTraceWorker( void* ptr ); 21 | 22 | void SysTraceGetExternalName( uint64_t thread, const char*& threadName, const char*& name ); 23 | 24 | } 25 | 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/client/TracyThread.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYTHREAD_HPP__ 2 | #define __TRACYTHREAD_HPP__ 3 | 4 | #if defined _WIN32 5 | # include 6 | #else 7 | # include 8 | #endif 9 | 10 | #ifdef TRACY_MANUAL_LIFETIME 11 | # include "tracy_rpmalloc.hpp" 12 | #endif 13 | 14 | namespace tracy 15 | { 16 | 17 | #ifdef TRACY_MANUAL_LIFETIME 18 | extern thread_local bool RpThreadInitDone; 19 | #endif 20 | 21 | class ThreadExitHandler 22 | { 23 | public: 24 | ~ThreadExitHandler() 25 | { 26 | #ifdef TRACY_MANUAL_LIFETIME 27 | rpmalloc_thread_finalize( 1 ); 28 | RpThreadInitDone = false; 29 | #endif 30 | } 31 | }; 32 | 33 | #if defined _WIN32 34 | 35 | class Thread 36 | { 37 | public: 38 | Thread( void(*func)( void* ptr ), void* ptr ) 39 | : m_func( func ) 40 | , m_ptr( ptr ) 41 | , m_hnd( CreateThread( nullptr, 0, Launch, this, 0, nullptr ) ) 42 | {} 43 | 44 | ~Thread() 45 | { 46 | WaitForSingleObject( m_hnd, INFINITE ); 47 | CloseHandle( m_hnd ); 48 | } 49 | 50 | HANDLE Handle() const { return m_hnd; } 51 | 52 | private: 53 | static DWORD WINAPI Launch( void* ptr ) { ((Thread*)ptr)->m_func( ((Thread*)ptr)->m_ptr ); return 0; } 54 | 55 | void(*m_func)( void* ptr ); 56 | void* m_ptr; 57 | HANDLE m_hnd; 58 | }; 59 | 60 | #else 61 | 62 | class Thread 63 | { 64 | public: 65 | Thread( void(*func)( void* ptr ), void* ptr ) 66 | : m_func( func ) 67 | , m_ptr( ptr ) 68 | { 69 | pthread_create( &m_thread, nullptr, Launch, this ); 70 | } 71 | 72 | ~Thread() 73 | { 74 | pthread_join( m_thread, nullptr ); 75 | } 76 | 77 | pthread_t Handle() const { return m_thread; } 78 | 79 | private: 80 | static void* Launch( void* ptr ) { ((Thread*)ptr)->m_func( ((Thread*)ptr)->m_ptr ); return nullptr; } 81 | void(*m_func)( void* ptr ); 82 | void* m_ptr; 83 | pthread_t m_thread; 84 | }; 85 | 86 | #endif 87 | 88 | } 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyAlign.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYALIGN_HPP__ 2 | #define __TRACYALIGN_HPP__ 3 | 4 | #include 5 | 6 | #include "TracyForceInline.hpp" 7 | 8 | namespace tracy 9 | { 10 | 11 | template 12 | tracy_force_inline T MemRead( const void* ptr ) 13 | { 14 | T val; 15 | memcpy( &val, ptr, sizeof( T ) ); 16 | return val; 17 | } 18 | 19 | template 20 | tracy_force_inline void MemWrite( void* ptr, T val ) 21 | { 22 | memcpy( ptr, &val, sizeof( T ) ); 23 | } 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyAlloc.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYALLOC_HPP__ 2 | #define __TRACYALLOC_HPP__ 3 | 4 | #include 5 | 6 | #if defined TRACY_ENABLE && !defined __EMSCRIPTEN__ 7 | # include "TracyApi.h" 8 | # include "TracyForceInline.hpp" 9 | # include "../client/tracy_rpmalloc.hpp" 10 | # define TRACY_USE_RPMALLOC 11 | #endif 12 | 13 | namespace tracy 14 | { 15 | 16 | #ifdef TRACY_USE_RPMALLOC 17 | TRACY_API void InitRpmalloc(); 18 | #else 19 | static inline void InitRpmalloc() {} 20 | #endif 21 | 22 | static inline void* tracy_malloc( size_t size ) 23 | { 24 | #ifdef TRACY_USE_RPMALLOC 25 | InitRpmalloc(); 26 | return rpmalloc( size ); 27 | #else 28 | return malloc( size ); 29 | #endif 30 | } 31 | 32 | static inline void* tracy_malloc_fast( size_t size ) 33 | { 34 | #ifdef TRACY_USE_RPMALLOC 35 | return rpmalloc( size ); 36 | #else 37 | return malloc( size ); 38 | #endif 39 | } 40 | 41 | static inline void tracy_free( void* ptr ) 42 | { 43 | #ifdef TRACY_USE_RPMALLOC 44 | InitRpmalloc(); 45 | rpfree( ptr ); 46 | #else 47 | free( ptr ); 48 | #endif 49 | } 50 | 51 | static inline void tracy_free_fast( void* ptr ) 52 | { 53 | #ifdef TRACY_USE_RPMALLOC 54 | rpfree( ptr ); 55 | #else 56 | free( ptr ); 57 | #endif 58 | } 59 | 60 | static inline void* tracy_realloc( void* ptr, size_t size ) 61 | { 62 | #ifdef TRACY_USE_RPMALLOC 63 | InitRpmalloc(); 64 | return rprealloc( ptr, size ); 65 | #else 66 | return realloc( ptr, size ); 67 | #endif 68 | } 69 | 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyApi.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYAPI_H__ 2 | #define __TRACYAPI_H__ 3 | 4 | #if defined _WIN32 5 | # if defined TRACY_EXPORTS 6 | # define TRACY_API __declspec(dllexport) 7 | # elif defined TRACY_IMPORTS 8 | # define TRACY_API __declspec(dllimport) 9 | # else 10 | # define TRACY_API 11 | # endif 12 | #else 13 | # define TRACY_API __attribute__((visibility("default"))) 14 | #endif 15 | 16 | #endif // __TRACYAPI_H__ 17 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyForceInline.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYFORCEINLINE_HPP__ 2 | #define __TRACYFORCEINLINE_HPP__ 3 | 4 | #if defined(__GNUC__) 5 | # define tracy_force_inline __attribute__((always_inline)) inline 6 | #elif defined(_MSC_VER) 7 | # define tracy_force_inline __forceinline 8 | #else 9 | # define tracy_force_inline inline 10 | #endif 11 | 12 | #if defined(__GNUC__) 13 | # define tracy_no_inline __attribute__((noinline)) 14 | #elif defined(_MSC_VER) 15 | # define tracy_no_inline __declspec(noinline) 16 | #else 17 | # define tracy_no_inline 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyMutex.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYMUTEX_HPP__ 2 | #define __TRACYMUTEX_HPP__ 3 | 4 | #if defined _MSC_VER 5 | 6 | # include 7 | 8 | namespace tracy 9 | { 10 | using TracyMutex = std::shared_mutex; 11 | } 12 | 13 | #else 14 | 15 | #include 16 | 17 | namespace tracy 18 | { 19 | using TracyMutex = std::mutex; 20 | } 21 | 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyStackFrames.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSTACKFRAMES_HPP__ 2 | #define __TRACYSTACKFRAMES_HPP__ 3 | 4 | #include 5 | 6 | namespace tracy 7 | { 8 | 9 | struct StringMatch 10 | { 11 | const char* str; 12 | size_t len; 13 | }; 14 | 15 | extern const char** s_tracyStackFrames; 16 | extern const StringMatch* s_tracySkipSubframes; 17 | 18 | static constexpr int s_tracySkipSubframesMinLen = 7; 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracySystem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSYSTEM_HPP__ 2 | #define __TRACYSYSTEM_HPP__ 3 | 4 | #include 5 | 6 | #include "TracyApi.h" 7 | 8 | namespace tracy 9 | { 10 | 11 | namespace detail 12 | { 13 | TRACY_API uint32_t GetThreadHandleImpl(); 14 | } 15 | 16 | #ifdef TRACY_ENABLE 17 | struct ThreadNameData 18 | { 19 | uint32_t id; 20 | int32_t groupHint; 21 | const char* name; 22 | ThreadNameData* next; 23 | }; 24 | 25 | ThreadNameData* GetThreadNameData( uint32_t id ); 26 | 27 | TRACY_API uint32_t GetThreadHandle(); 28 | #else 29 | static inline uint32_t GetThreadHandle() 30 | { 31 | return detail::GetThreadHandleImpl(); 32 | } 33 | #endif 34 | 35 | TRACY_API void SetThreadName( const char* name ); 36 | TRACY_API void SetThreadNameWithHint( const char* name, int32_t groupHint ); 37 | TRACY_API const char* GetThreadName( uint32_t id ); 38 | 39 | TRACY_API const char* GetEnvVar( const char* name ); 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyUwp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYUWP_HPP__ 2 | #define __TRACYUWP_HPP__ 3 | 4 | #ifdef _WIN32 5 | # include 6 | # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 7 | # define TRACY_UWP 8 | # endif 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyVersion.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYVERSION_HPP__ 2 | #define __TRACYVERSION_HPP__ 3 | 4 | namespace tracy 5 | { 6 | namespace Version 7 | { 8 | enum { Major = 0 }; 9 | enum { Minor = 12 }; 10 | enum { Patch = 0 }; 11 | } 12 | } 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/common/TracyYield.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYYIELD_HPP__ 2 | #define __TRACYYIELD_HPP__ 3 | 4 | #if defined __SSE2__ || defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP == 2) 5 | # include 6 | #else 7 | # include 8 | #endif 9 | 10 | #include "TracyForceInline.hpp" 11 | 12 | namespace tracy 13 | { 14 | 15 | static tracy_force_inline void YieldThread() 16 | { 17 | #if defined __SSE2__ || defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP == 2) 18 | _mm_pause(); 19 | #elif defined __aarch64__ 20 | asm volatile( "isb" : : ); 21 | #else 22 | std::this_thread::yield(); 23 | #endif 24 | } 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/libbacktrace/LICENSE: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012-2016 Free Software Foundation, Inc. 2 | 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | 7 | # (1) Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | 10 | # (2) Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in 12 | # the documentation and/or other materials provided with the 13 | # distribution. 14 | 15 | # (3) The name of the author may not be used to 16 | # endorse or promote products derived from this software without 17 | # specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 23 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 28 | # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/libbacktrace/config.h: -------------------------------------------------------------------------------- 1 | #include 2 | #if defined(__linux__) && !defined(__GLIBC__) && !defined(__WORDSIZE) 3 | // include __WORDSIZE headers for musl 4 | # include 5 | #endif 6 | #if __WORDSIZE == 64 7 | # define BACKTRACE_ELF_SIZE 64 8 | #else 9 | # define BACKTRACE_ELF_SIZE 32 10 | #endif 11 | 12 | #define HAVE_DLFCN_H 1 13 | #define HAVE_FCNTL 1 14 | #define HAVE_INTTYPES_H 1 15 | #define HAVE_LSTAT 1 16 | #define HAVE_READLINK 1 17 | #define HAVE_DL_ITERATE_PHDR 1 18 | #define HAVE_ATOMIC_FUNCTIONS 1 19 | #define HAVE_DECL_STRNLEN 1 20 | 21 | #ifdef __APPLE__ 22 | # define HAVE_MACH_O_DYLD_H 1 23 | #elif defined BSD 24 | # define HAVE_KERN_PROC 1 25 | # define HAVE_KERN_PROC_ARGS 1 26 | #endif 27 | -------------------------------------------------------------------------------- /project/thirdparty/tracy-0.12.0/libbacktrace/filenames.hpp: -------------------------------------------------------------------------------- 1 | /* btest.c -- Filename header for libbacktrace library 2 | Copyright (C) 2012-2018 Free Software Foundation, Inc. 3 | Written by Ian Lance Taylor, Google. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | (1) Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | (2) Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the 15 | distribution. 16 | 17 | (3) The name of the author may not be used to 18 | endorse or promote products derived from this software without 19 | specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 25 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. */ 32 | 33 | #ifndef GCC_VERSION 34 | # define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) 35 | #endif 36 | 37 | #if (GCC_VERSION < 2007) 38 | # define __attribute__(x) 39 | #endif 40 | 41 | #ifndef ATTRIBUTE_UNUSED 42 | # define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 43 | #endif 44 | 45 | #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__) 46 | # define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\') 47 | # define HAS_DRIVE_SPEC(f) ((f)[0] != '\0' && (f)[1] == ':') 48 | # define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || HAS_DRIVE_SPEC(f)) 49 | #else 50 | # define IS_DIR_SEPARATOR(c) ((c) == '/') 51 | # define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0])) 52 | #endif 53 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/INDEX: -------------------------------------------------------------------------------- 1 | CMakeLists.txt cmake build file 2 | ChangeLog history of changes 3 | FAQ Frequently Asked Questions about zlib 4 | INDEX this file 5 | Makefile dummy Makefile that tells you to ./configure 6 | Makefile.in template for Unix Makefile 7 | README guess what 8 | configure configure script for Unix 9 | make_vms.com makefile for VMS 10 | test/example.c zlib usages examples for build testing 11 | test/minigzip.c minimal gzip-like functionality for build testing 12 | test/infcover.c inf*.c code coverage for build coverage testing 13 | treebuild.xml XML description of source file dependencies 14 | zconf.h.cmakein zconf.h template for cmake 15 | zconf.h.in zconf.h template for configure 16 | zlib.3 Man page for zlib 17 | zlib.3.pdf Man page in PDF format 18 | zlib.map Linux symbol information 19 | zlib.pc.in Template for pkg-config descriptor 20 | zlib.pc.cmakein zlib.pc template for cmake 21 | zlib2ansi perl script to convert source files for C++ compilation 22 | 23 | amiga/ makefiles for Amiga SAS C 24 | as400/ makefiles for AS/400 25 | doc/ documentation for formats and algorithms 26 | msdos/ makefiles for MSDOS 27 | nintendods/ makefile for Nintendo DS 28 | old/ makefiles for various architectures and zlib documentation 29 | files that have not yet been updated for zlib 1.2.x 30 | qnx/ makefiles for QNX 31 | watcom/ makefiles for OpenWatcom 32 | win32/ makefiles for Windows 33 | 34 | zlib public header files (required for library use): 35 | zconf.h 36 | zlib.h 37 | 38 | private source files used to build the zlib library: 39 | adler32.c 40 | compress.c 41 | crc32.c 42 | crc32.h 43 | deflate.c 44 | deflate.h 45 | gzclose.c 46 | gzguts.h 47 | gzlib.c 48 | gzread.c 49 | gzwrite.c 50 | infback.c 51 | inffast.c 52 | inffast.h 53 | inffixed.h 54 | inflate.c 55 | inflate.h 56 | inftrees.c 57 | inftrees.h 58 | trees.c 59 | trees.h 60 | uncompr.c 61 | zutil.c 62 | zutil.h 63 | 64 | source files for sample programs 65 | See examples/README.examples 66 | 67 | unsupported contributions by third parties 68 | See contrib/README.contrib 69 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright notice: 2 | 3 | (C) 1995-2022 Jean-loup Gailly and Mark Adler 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Jean-loup Gailly Mark Adler 22 | jloup@gzip.org madler@alumni.caltech.edu 23 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | -@echo "Please use ./configure first. Thank you." 3 | 4 | distclean: 5 | make -f Makefile.in distclean 6 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(gzFile file) { 12 | #ifndef NO_GZCOMPRESS 13 | gz_statep state; 14 | 15 | if (file == NULL) 16 | return Z_STREAM_ERROR; 17 | state = (gz_statep)file; 18 | 19 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 20 | #else 21 | return gzclose_r(file); 22 | #endif 23 | } 24 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); 12 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/zlib.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaxeFoundation/hxcpp/a428509569b8fa251f2317aa0fe9ed2de1927980/project/thirdparty/zlib-1.3.1/zlib.3.pdf -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/zlib.map: -------------------------------------------------------------------------------- 1 | ZLIB_1.2.0 { 2 | global: 3 | compressBound; 4 | deflateBound; 5 | inflateBack; 6 | inflateBackEnd; 7 | inflateBackInit_; 8 | inflateCopy; 9 | local: 10 | deflate_copyright; 11 | inflate_copyright; 12 | inflate_fast; 13 | inflate_table; 14 | zcalloc; 15 | zcfree; 16 | z_errmsg; 17 | gz_error; 18 | gz_intmax; 19 | _*; 20 | }; 21 | 22 | ZLIB_1.2.0.2 { 23 | gzclearerr; 24 | gzungetc; 25 | zlibCompileFlags; 26 | } ZLIB_1.2.0; 27 | 28 | ZLIB_1.2.0.8 { 29 | deflatePrime; 30 | } ZLIB_1.2.0.2; 31 | 32 | ZLIB_1.2.2 { 33 | adler32_combine; 34 | crc32_combine; 35 | deflateSetHeader; 36 | inflateGetHeader; 37 | } ZLIB_1.2.0.8; 38 | 39 | ZLIB_1.2.2.3 { 40 | deflateTune; 41 | gzdirect; 42 | } ZLIB_1.2.2; 43 | 44 | ZLIB_1.2.2.4 { 45 | inflatePrime; 46 | } ZLIB_1.2.2.3; 47 | 48 | ZLIB_1.2.3.3 { 49 | adler32_combine64; 50 | crc32_combine64; 51 | gzopen64; 52 | gzseek64; 53 | gztell64; 54 | inflateUndermine; 55 | } ZLIB_1.2.2.4; 56 | 57 | ZLIB_1.2.3.4 { 58 | inflateReset2; 59 | inflateMark; 60 | } ZLIB_1.2.3.3; 61 | 62 | ZLIB_1.2.3.5 { 63 | gzbuffer; 64 | gzoffset; 65 | gzoffset64; 66 | gzclose_r; 67 | gzclose_w; 68 | } ZLIB_1.2.3.4; 69 | 70 | ZLIB_1.2.5.1 { 71 | deflatePending; 72 | } ZLIB_1.2.3.5; 73 | 74 | ZLIB_1.2.5.2 { 75 | deflateResetKeep; 76 | gzgetc_; 77 | inflateResetKeep; 78 | } ZLIB_1.2.5.1; 79 | 80 | ZLIB_1.2.7.1 { 81 | inflateGetDictionary; 82 | gzvprintf; 83 | } ZLIB_1.2.5.2; 84 | 85 | ZLIB_1.2.9 { 86 | inflateCodesUsed; 87 | inflateValidate; 88 | uncompress2; 89 | gzfread; 90 | gzfwrite; 91 | deflateGetDictionary; 92 | adler32_z; 93 | crc32_z; 94 | } ZLIB_1.2.7.1; 95 | 96 | ZLIB_1.2.12 { 97 | crc32_combine_gen; 98 | crc32_combine_gen64; 99 | crc32_combine_op; 100 | } ZLIB_1.2.9; 101 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/zlib.pc.cmakein: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@INSTALL_LIB_DIR@ 4 | sharedlibdir=@INSTALL_LIB_DIR@ 5 | includedir=@INSTALL_INC_DIR@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /project/thirdparty/zlib-1.3.1/zlib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | sharedlibdir=@sharedlibdir@ 5 | includedir=@includedir@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /run.n: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaxeFoundation/hxcpp/a428509569b8fa251f2317aa0fe9ed2de1927980/run.n -------------------------------------------------------------------------------- /src/ExampleMain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This is an example mainline that can be used to link a static version. 3 | First you need to build the static version of the standard libs, with: 4 | cd $HXCPP/project 5 | neko build.n clean static-windows 6 | 7 | Then the static verion of your application with (note: extra space before 'static_link'): 8 | 9 | haxe -main YourMain -cpp cpp -D static_link 10 | 11 | You then need to link the above libraries with this (or a modified version) main. 12 | You may choose to create a VisualStudio project, and add the libraries from 13 | $HXCPP/bin/Windows/(std,regexp,zlib).lib and your application library. 14 | 15 | Note also, that if you compile with the -debug flag, your library will have a different name. 16 | 17 | Linking from the command line for windows (developer command prompt for vs; user32.lib only required for debug version; 18 | ws2_32.lib might be necessary if there are error messages): 19 | 20 | cl ExampleMain.cpp cpp/YourMain.lib $HXCPP/bin/Windows/std.lib $HXCPP/bin/Windows/zlib.lib $HXCPP/bin/Windows/regexp.lib user32.lib 21 | 22 | From other OSs, the compile+link command will be different. Here is one for mac: 23 | 24 | g++ ExampleMain.cpp cpp/Test-debug.a $HXCPP/bin/Mac/regexp.a $HXCPP/bin/Mac/std.a $HXCPP/bin/Mac/zlib.a 25 | 26 | If you wish to add other static libraries besides these 3 (eg, nme) you will 27 | need to compile these with the "-Dstatic_link" flag too, and call their "register_prims" 28 | init call. The inclusion of the extra static library will require the library 29 | in the link line, and may requires additional dependencies to be linked. 30 | Also note, that there may be licensing implications with static linking 31 | thirdparty libraries. 32 | 33 | */ 34 | 35 | #include 36 | 37 | extern "C" const char *hxRunLibrary(); 38 | extern "C" void hxcpp_set_top_of_stack(); 39 | 40 | 41 | // Declare additional library entry points... 42 | //extern "C" int nme_register_prims(); 43 | 44 | extern "C" int main(int argc, char *argv[]) 45 | { 46 | // Do this first 47 | hxcpp_set_top_of_stack(); 48 | 49 | // Register additional ndll libaries ... 50 | // nme_register_prims(); 51 | 52 | //printf("Begin!\n"); 53 | const char *err = hxRunLibrary(); 54 | if (err) { 55 | // Unhandled exceptions ... 56 | fprintf(stderr,"Error %s\n", err ); 57 | return -1; 58 | } 59 | //printf("Done!\n"); 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /src/hx/AndroidCompat.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | // These functions are inlined prior to android-ndk-platform-21, which means they 10 | // are missing from the libc functions on those phones, and you will get link errors. 11 | 12 | #if (HXCPP_ANDROID_PLATFORM>=21) && !defined(HXCPP_ARM64) 13 | extern "C" { 14 | 15 | 16 | char * stpcpy(char *dest, const char *src) 17 | { 18 | char *d = dest; 19 | const char *s = src; 20 | do 21 | *d++ = *s; 22 | while (*s++ != '\0'); 23 | return d - 1; 24 | } 25 | 26 | 27 | int rand() { return lrand48(); } 28 | 29 | void srand(unsigned int x) { srand48(x); } 30 | 31 | 32 | double atof(const char *nptr) 33 | { 34 | return (strtod(nptr, 0)); 35 | } 36 | // extern __sighandler_t bsd_signal(int, __sighandler_t); 37 | 38 | 39 | typedef __sighandler_t (*bsd_signal_func_t)(int, __sighandler_t); 40 | bsd_signal_func_t bsd_signal_func = 0; 41 | 42 | __sighandler_t bsd_signal(int s, __sighandler_t f) 43 | { 44 | if (bsd_signal_func == 0) 45 | { 46 | // For now (up to Android 7.0) this is always available 47 | bsd_signal_func = (bsd_signal_func_t) dlsym(RTLD_DEFAULT, "bsd_signal"); 48 | 49 | if (bsd_signal_func == 0) 50 | { 51 | // You may try dlsym(RTLD_DEFAULT, "signal") or dlsym(RTLD_NEXT, "signal") here 52 | // Make sure you add a comment here in StackOverflow 53 | // if you find a device that doesn't have "bsd_signal" in its libc.so!!! 54 | 55 | __android_log_assert("", "bsd_signal_wrapper", "bsd_signal symbol not found!"); 56 | } 57 | } 58 | 59 | return bsd_signal_func(s, f); 60 | } 61 | 62 | __sighandler_t signal(int s, __sighandler_t f) 63 | { 64 | return bsd_signal(s,f); 65 | } 66 | 67 | } 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /src/hx/Boot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef HX_WINRT 5 | #include 6 | #endif 7 | namespace hx 8 | { 9 | 10 | void Boot() 11 | { 12 | //__hxcpp_enable(false); 13 | #ifdef HX_WINRT 14 | HRESULT hr = ::RoInitialize( RO_INIT_MULTITHREADED ); 15 | #endif 16 | 17 | #ifdef GPH 18 | setvbuf( stdout , 0 , _IONBF , 0 ); 19 | setvbuf( stderr , 0 , _IONBF , 0 ); 20 | #endif 21 | 22 | __hxcpp_stdlibs_boot(); 23 | Object::__boot(); 24 | Dynamic::__boot(); 25 | hx::Class_obj::__boot(); 26 | String::__boot(); 27 | Anon_obj::__boot(); 28 | ArrayBase::__boot(); 29 | EnumBase_obj::__boot(); 30 | Math_obj::__boot(); 31 | } 32 | 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/hx/NoFiles.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace hx { 4 | const char *__hxcpp_all_files[] = { 5 | 0 }; 6 | 7 | const char *__hxcpp_all_files_fullpath[] = { 8 | 0 }; 9 | 10 | const char *__hxcpp_all_classes[] = { 11 | 0 }; 12 | } // namespace hx 13 | void __files__boot() { __hxcpp_set_debugger_info(hx::__hxcpp_all_classes, hx::__hxcpp_all_files_fullpath); } 14 | 15 | -------------------------------------------------------------------------------- /src/hx/RunLibs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Use the "hxRunLibrary" code to run the static version of the code 3 | */ 4 | #include 5 | #include 6 | 7 | 8 | extern "C" 9 | { 10 | void __hxcpp_lib_main(); 11 | 12 | 13 | std::string sgResultBuffer; 14 | 15 | HXCPP_EXTERN_CLASS_ATTRIBUTES const HX_CHAR *hxRunLibrary() 16 | { 17 | try { 18 | __hxcpp_lib_main(); 19 | return 0; 20 | } 21 | catch ( Dynamic d ) { 22 | sgResultBuffer = d->toString().__s; 23 | return sgResultBuffer.c_str(); 24 | } 25 | } 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/hx/cppia/sljit_src/README: -------------------------------------------------------------------------------- 1 | 2 | SLJIT - Stack Less JIT Compiler 3 | 4 | Purpose: 5 | A simple, machine independent JIT compiler, which suitable for 6 | translating interpreted byte code to machine code. The sljitLir.h 7 | describes the LIR (low-level intermediate representation) of SLJIT. 8 | 9 | Compatible: 10 | Any C (C++) compiler. At least I hope so. 11 | 12 | Using sljit: 13 | Copy the content of sljit_src directory into your project source directory. 14 | Add sljitLir.c source file to your build environment. All other files are 15 | included by sljitLir.c (if required). Define the machine by SLJIT_CONFIG_* 16 | selector. See sljitConfig.h for all possible values. For C++ compilers, 17 | rename sljitLir.c to sljitLir.cpp. 18 | 19 | More info: 20 | http://sljit.sourceforge.net/ 21 | 22 | Contact: 23 | hzmester@freemail.hu 24 | 25 | Special thanks: 26 | Alexander Nasonov 27 | Daniel Richard G. 28 | Giuseppe D'Angelo 29 | Jiong Wang (TileGX support) 30 | -------------------------------------------------------------------------------- /src/hx/libs/mysql/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/hx/libs/mysql/sha1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2005-2012 Haxe Foundation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | #ifndef SHA1_H 23 | #define SHA1_H 24 | 25 | #define SHA1_SIZE 20 26 | 27 | typedef unsigned char SHA1_DIGEST[SHA1_SIZE]; 28 | 29 | typedef struct { 30 | unsigned int state[5]; 31 | unsigned int count[2]; 32 | unsigned char buffer[64]; 33 | } SHA1_CTX; 34 | 35 | void sha1_init( SHA1_CTX *c ); 36 | void sha1_update( SHA1_CTX *c, const unsigned char *data, unsigned int len ); 37 | void sha1_final( SHA1_CTX *c, SHA1_DIGEST digest ); 38 | 39 | #endif 40 | /* ************************************************************************ */ 41 | -------------------------------------------------------------------------------- /src/hx/libs/mysql/socket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2005-2012 Haxe Foundation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | #ifndef SOCKET_H 23 | #define SOCKET_H 24 | 25 | #include 26 | 27 | #ifdef NEKO_WINDOWS 28 | # include 29 | typedef SOCKET PSOCK; 30 | #else 31 | typedef int PSOCK; 32 | # define INVALID_SOCKET (-1) 33 | #endif 34 | 35 | typedef unsigned int PHOST; 36 | 37 | #define UNRESOLVED_HOST ((PHOST)-1) 38 | 39 | typedef enum { 40 | PS_OK = 0, 41 | PS_ERROR = -1, 42 | PS_BLOCK = -2, 43 | } SERR; 44 | 45 | void psock_init(); 46 | PSOCK psock_create(); 47 | void psock_close( PSOCK s ); 48 | SERR psock_connect( PSOCK s, PHOST h, int port ); 49 | SERR psock_set_timeout( PSOCK s, double timeout ); 50 | SERR psock_set_blocking( PSOCK s, int block ); 51 | SERR psock_set_fastsend( PSOCK s, int fast ); 52 | 53 | int psock_send( PSOCK s, const char *buf, int size ); 54 | int psock_recv( PSOCK s, char *buf, int size ); 55 | 56 | int psock_send_no_gc( PSOCK s, const char *buf, int size ); 57 | int psock_recv_no_gc( PSOCK s, char *buf, int size ); 58 | 59 | PHOST phost_resolve( const char *hostname ); 60 | 61 | #endif 62 | /* ************************************************************************ */ 63 | -------------------------------------------------------------------------------- /src/hx/libs/regexp/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/hx/libs/regexp/pcre2_sources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/hx/libs/sqlite/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/hx/libs/ssl/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/hx/libs/std/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/hx/libs/zlib/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 |
47 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # hxcpp tests 2 | 3 | The tests here are hxcpp specific. Notice that there are more target independent tests available in the [haxe repo](https://github.com/HaxeFoundation/haxe). 4 | 5 | ## Running the tests 6 | 7 | haxe --run RunTests 8 | -------------------------------------------------------------------------------- /test/cffi/compile-neko.hxml: -------------------------------------------------------------------------------- 1 | -p src 2 | -m TestMain 3 | -L utest 4 | --neko bin/neko/TestMain.n -------------------------------------------------------------------------------- /test/cffi/compile-utf8.hxml: -------------------------------------------------------------------------------- 1 | -p src 2 | -m TestMain 3 | -L utest 4 | -D disable_unicode_strings 5 | --cpp bin/cpp-utf8 -------------------------------------------------------------------------------- /test/cffi/compile.hxml: -------------------------------------------------------------------------------- 1 | -p src 2 | -m TestMain 3 | -L utest 4 | --cpp bin/cpp -------------------------------------------------------------------------------- /test/cffi/project/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/cffi/src/Loader.hx: -------------------------------------------------------------------------------- 1 | #if macro 2 | import haxe.macro.Expr; 3 | #end 4 | 5 | 6 | class Loader 7 | { 8 | #if cpp 9 | public static function __init__() 10 | { 11 | cpp.Lib.pushDllSearchPath( "project/ndll/" + cpp.Lib.getBinDirectory() ); 12 | } 13 | #end 14 | 15 | public static inline macro function load(inName2:Expr, inSig:Expr) 16 | { 17 | return macro cpp.Prime.load("prime", $inName2, $inSig, false); 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /test/cffi/src/TestMain.hx: -------------------------------------------------------------------------------- 1 | 2 | class TestMain 3 | { 4 | public static function main() 5 | { 6 | utest.UTest.run([ new TestCffi(), new TestPrime() ]); 7 | } 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/cppia/ClientExtendedExtendedRoot.hx: -------------------------------------------------------------------------------- 1 | class ClientExtendedExtendedRoot extends HostExtendedRoot { 2 | override function addValue() { 3 | super.addValue(); 4 | 5 | values.push(2); 6 | } 7 | } -------------------------------------------------------------------------------- /test/cppia/ClientExtends.hx: -------------------------------------------------------------------------------- 1 | class ClientExtends extends HostBase implements IClientInterface implements IClientHostInterface 2 | { 3 | public function new() 4 | { 5 | super(); 6 | } 7 | 8 | public function ok():Bool 9 | { 10 | return getVal()==1.25; 11 | } 12 | 13 | public function testOne() 14 | { 15 | return getOne()==1; 16 | } 17 | 18 | public function testOneExtended() 19 | { 20 | return getOne()==111; 21 | } 22 | 23 | 24 | #if (hxcpp_api_level>=400) 25 | public function testPointers() : Bool 26 | { 27 | pointerDest = pointerSrc; 28 | return getDestVal()==4; 29 | } 30 | 31 | override public function getGeneration() 32 | { 33 | return super.getGeneration() + 1; 34 | } 35 | #else 36 | override public function getGeneration() 37 | { 38 | return super.getGeneration() + 1; 39 | } 40 | #end 41 | 42 | override public function whoStartedYou() : String return super.whoStartedYou(); 43 | 44 | // override IHostInteface 45 | override public function whoOverridesYou() return "ClientExtends"; 46 | 47 | // new IClientInterface 48 | public function uniqueClientFunc() return "uniqueClientFunc"; 49 | 50 | // IClientHostInterface 51 | public function whoAreYou() return "ClientExtends"; 52 | 53 | public function getOne() return 1; 54 | 55 | public function getTwo() return 2; 56 | 57 | public function getThree() return 3; 58 | 59 | override public function update() return "ClientExtends update"; 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /test/cppia/ClientExtends2.hx: -------------------------------------------------------------------------------- 1 | class ClientExtends2 extends ClientExtends 2 | { 3 | public function new() 4 | { 5 | super(); 6 | } 7 | 8 | override public function getGeneration() 9 | { 10 | return super.getGeneration()+1; 11 | } 12 | 13 | public function getFour() return 4; 14 | 15 | public function testFour() : Bool 16 | { 17 | return getFour()==4; 18 | } 19 | 20 | override public function getOne() return 111; 21 | 22 | override public function update() return "ClientExtends2 update"; 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/cppia/ClientIHostImpl.hx: -------------------------------------------------------------------------------- 1 | class ClientIHostImpl implements IHostInterface 2 | { 3 | public function new() { } 4 | 5 | public function hostImplOnly(i:Int, s:String, f:Float) : String return "client"; 6 | public function whoStartedYou() : String return "client"; 7 | public function whoOverridesYou() : String return "client"; 8 | } 9 | -------------------------------------------------------------------------------- /test/cppia/Common.hx: -------------------------------------------------------------------------------- 1 | class Common 2 | { 3 | public static var status:String = "tests not run"; 4 | public static var hostImplementation:pack.HostInterface; 5 | public static var clientImplementation:pack.HostInterface; 6 | public static var clientRoot:HostRoot; 7 | 8 | public static var callbackSet:Int = 0; 9 | public static var callback: Void->Void; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/cppia/CppiaHost.hx: -------------------------------------------------------------------------------- 1 | import utest.UTest; 2 | import utest.Test; 3 | 4 | class CppiaHost extends Test 5 | { 6 | public static function main() { 7 | UTest.run([ new cases.TestCommon() ]); 8 | } 9 | } -------------------------------------------------------------------------------- /test/cppia/HostBase.hx: -------------------------------------------------------------------------------- 1 | #if (hxcpp_api_level>=400) 2 | import cpp.Native; 3 | #end 4 | 5 | class HostBase implements IHostInterface 6 | { 7 | static var hostInit = 10; 8 | public static var hostBool0 = true; 9 | public static var hostBool1 = false; 10 | public static var hostBool2 = true; 11 | public static var hostBool3 = false; 12 | 13 | var floatVal:Float; 14 | var pointerSrc:cpp.Star; 15 | var pointerDest:cpp.Star; 16 | 17 | public function new() 18 | { 19 | floatVal = 1.25; 20 | #if (hxcpp_api_level>=400) 21 | pointerSrc = Native.malloc( Native.sizeof(Int) ); 22 | Native.set(pointerSrc,4); 23 | pointerDest = null; 24 | #end 25 | } 26 | 27 | public function getDestVal() : Int 28 | { 29 | #if (hxcpp_api_level>=400) 30 | if (pointerDest==null) 31 | return -1; 32 | return Native.get(pointerDest); 33 | #else 34 | return 4; 35 | #end 36 | } 37 | 38 | public function getYou() : HostBase 39 | { 40 | return this; 41 | } 42 | 43 | public function testUpdateOverride() : Bool 44 | { 45 | return update()=="ClientExtends2 update"; 46 | } 47 | 48 | 49 | public function getVal() return floatVal; 50 | 51 | public function getGeneration() return 0; 52 | 53 | public function update() return "HostBase update"; 54 | 55 | // IHostInteface 56 | public function hostImplOnly(i:Int, s:String, f:Float) : String return i+s+f; 57 | public function whoStartedYou() return "HostBase"; 58 | public function whoOverridesYou() return "No one"; 59 | } 60 | -------------------------------------------------------------------------------- /test/cppia/HostExtendedRoot.hx: -------------------------------------------------------------------------------- 1 | class HostExtendedRoot extends HostRoot { 2 | override function addValue() { 3 | super.addValue(); 4 | 5 | values.push(1); 6 | } 7 | } -------------------------------------------------------------------------------- /test/cppia/HostRoot.hx: -------------------------------------------------------------------------------- 1 | class HostRoot { 2 | public final values:Array; 3 | 4 | public function new() { 5 | values = []; 6 | } 7 | 8 | public function addValue() { 9 | values.push(0); 10 | } 11 | } -------------------------------------------------------------------------------- /test/cppia/IClientHostInterface.hx: -------------------------------------------------------------------------------- 1 | // Same as IHostInterface, but not implemented in host 2 | interface IClientHostInterface extends IHostInterface 3 | { 4 | public function whoAreYou() : String; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/cppia/IClientInterface.hx: -------------------------------------------------------------------------------- 1 | interface IClientInterface 2 | { 3 | // Same as IHostInterface, but not implemented in host 4 | public function whoStartedYou() : String; 5 | public function whoOverridesYou() : String; 6 | public function uniqueClientFunc() : String; 7 | } 8 | -------------------------------------------------------------------------------- /test/cppia/IFoo.hx: -------------------------------------------------------------------------------- 1 | interface IFoo { 2 | function baz() : String; 3 | } -------------------------------------------------------------------------------- /test/cppia/IHostInterface.hx: -------------------------------------------------------------------------------- 1 | interface IHostInterface 2 | { 3 | public function hostImplOnly(i:Int, s:String, f:Float) : String; 4 | public function whoStartedYou() : String; 5 | public function whoOverridesYou() : String; 6 | } 7 | -------------------------------------------------------------------------------- /test/cppia/LocalFunctionExceptions.hx: -------------------------------------------------------------------------------- 1 | enum Status { 2 | Ok; 3 | Error(message:String); 4 | } 5 | 6 | class LocalFunctionExceptions { 7 | static function staticFunction() { 8 | throw 'Thrown from static'; 9 | } 10 | 11 | public static function testLocalCallingStatic():Status { 12 | function localFunction() { 13 | staticFunction(); 14 | throw 'Thrown from local'; 15 | } 16 | 17 | try { 18 | localFunction(); 19 | } catch (e:String) { 20 | if (e == 'Thrown from static') { 21 | return Ok; 22 | } else { 23 | return Error("Incorrect exception caught from local function call"); 24 | } 25 | } 26 | 27 | return Error("No exception caught"); 28 | } 29 | 30 | public static function testCatchWithinLocal():Status { 31 | function localFunction() { 32 | try { 33 | staticFunction(); 34 | } catch (e:String) { 35 | if (e == 'Thrown from static') { 36 | return Ok; 37 | } else { 38 | return Error("Incorrect exception caught from local function call"); 39 | } 40 | } 41 | return Error("Exception from static function not caught"); 42 | } 43 | 44 | return try { 45 | localFunction(); 46 | } catch (e) { 47 | Error('Exception leaked from local function: $e'); 48 | }; 49 | } 50 | 51 | public static function testCatchFromLocal():Status { 52 | function localFunction() { 53 | throw 'Thrown from local'; 54 | } 55 | 56 | try { 57 | localFunction(); 58 | } catch (e:String) { 59 | if (e == 'Thrown from local') { 60 | return Ok; 61 | } else { 62 | return Error("Incorrect exception caught from local function call"); 63 | } 64 | } 65 | 66 | return Error("No exception caught"); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /test/cppia/compile-client.hxml: -------------------------------------------------------------------------------- 1 | -m Client 2 | -D dll_import=host_classes.info 3 | --cppia bin/client.cppia -------------------------------------------------------------------------------- /test/cppia/compile-host.hxml: -------------------------------------------------------------------------------- 1 | -m CppiaHost 2 | -D scriptable 3 | -D dll_export=host_classes.info 4 | -L utest 5 | --dce no 6 | --cpp bin -------------------------------------------------------------------------------- /test/cppia/pack/HostInterface.hx: -------------------------------------------------------------------------------- 1 | package pack; 2 | 3 | interface HostInterface 4 | { 5 | public function getOne() : Int; 6 | public function getOneString() : String; 7 | } 8 | -------------------------------------------------------------------------------- /test/debugger/App.hx: -------------------------------------------------------------------------------- 1 | 2 | class App 3 | { 4 | public static var hasRunBreakMe = false; 5 | public static var hasRunBreakMe2 = false; 6 | 7 | function breakMe() 8 | { 9 | hasRunBreakMe = true; 10 | } 11 | 12 | function breakMe2() hasRunBreakMe2 = true; 13 | 14 | 15 | public function new() 16 | { 17 | breakMe(); 18 | breakMe2(); 19 | Lines.lineStep(); 20 | } 21 | 22 | public static function main() 23 | { 24 | TestDebugger.setup(); 25 | 26 | new App(); 27 | 28 | if (!TestDebugger.finished) 29 | { 30 | Sys.println("Not all breakpoints triggered"); 31 | Sys.exit(-1); 32 | } 33 | else if (!TestDebugger.ok) 34 | { 35 | Sys.println("Some debugger checks failed"); 36 | Sys.exit(-1); 37 | } 38 | else 39 | { 40 | Sys.println("All good!"); 41 | } 42 | 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /test/debugger/Lines.hx: -------------------------------------------------------------------------------- 1 | class Lines // line 1 2 | { // line 2 3 | public static var line = -1; // line 3 4 | // line 4 5 | public static function lineStep() // line 5 6 | { // line 6 7 | line = 7; // line 7; 8 | callFunction(); // 8 9 | line = 9; // line 9; 10 | callFunction(); // 10 11 | // 11 12 | line = 12; // 12 13 | } // line 13 14 | // 14 15 | public static function callFunction() // 15 16 | { // 16 17 | // 17 18 | line = 18; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/debugger/compile.hxml: -------------------------------------------------------------------------------- 1 | -m App 2 | -D hxcpp_debugger 3 | -D HXCPP_DEBUGGER 4 | --cpp bin 5 | --debug -------------------------------------------------------------------------------- /test/extern-lib/api/HaxeApi.hx: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | @:nativeGen 4 | @:structAccess 5 | class HaxeApi 6 | { 7 | @:keep 8 | public static function createBase( ) : HaxeObject return new impl.HaxeImpl(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/extern-lib/api/HaxeObject.hx: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | @:nativeGen 4 | interface HaxeObject 5 | { 6 | public function getName( ):cpp.StdString; 7 | public function setName( inName:cpp.StdStringRef ) : Void; 8 | public function createChild() : HaxeObject; 9 | public function printInt(x:Int):Void; 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/extern-lib/compile-api.hxml: -------------------------------------------------------------------------------- 1 | --cpp gen-externs 2 | -D static_link 3 | api.HaxeApi -------------------------------------------------------------------------------- /test/extern-lib/impl/HaxeImpl.hx: -------------------------------------------------------------------------------- 1 | package impl; 2 | 3 | import api.HaxeObject; 4 | 5 | @:keep 6 | class HaxeImpl implements HaxeObject 7 | { 8 | var parentName:String; 9 | var name:String; 10 | var haxeObject:HaxeObject; 11 | 12 | public function new(?inParent:HaxeImpl) 13 | { 14 | haxeObject = null; 15 | parentName = inParent==null ? "" : inParent.name; 16 | if (haxeObject==null) 17 | haxeObject = this; 18 | } 19 | 20 | public function getName( ):cpp.StdString 21 | { 22 | return cpp.StdString.ofString(name); 23 | } 24 | 25 | @:unreflective 26 | public function setName( inName:cpp.StdStringRef ) : Void 27 | { 28 | name = inName.toString(); 29 | } 30 | 31 | public function createChild() : HaxeObject 32 | { 33 | var child = new HaxeImpl(this); 34 | return child; 35 | } 36 | 37 | public function printInt(x:Int):Void 38 | { 39 | Sys.println( Std.string(x) ); 40 | } 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test/extern-use/Build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/extern-use/Main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | struct MyStruct 9 | { 10 | hx::Ref haxeRef; 11 | }; 12 | 13 | extern void __hxcpp_collect(bool inMajor); 14 | 15 | bool checkAttachNone(const char *where) 16 | { 17 | if (hx::GcGetThreadAttachedCount()!=0) 18 | { 19 | printf("Bad attach count - something attached: %s\n",where); 20 | return false; 21 | } 22 | return true; 23 | } 24 | 25 | int main(int argc, char **argv) 26 | { 27 | MyStruct *myStruct = new MyStruct(); 28 | 29 | 30 | if (!checkAttachNone("before creation")) 31 | return -1; 32 | 33 | { 34 | hx::NativeAttach autoAttach; 35 | const char *err = hx::Init(false); 36 | if (err) 37 | { 38 | printf("Could not initialize library: %s\n", err); 39 | return -1; 40 | } 41 | } 42 | 43 | 44 | if (!checkAttachNone("after init")) 45 | return -1; 46 | 47 | { 48 | hx::NativeAttach autoAttach; 49 | 50 | api::HaxeObject *obj = api::HaxeApi::createBase(); 51 | obj->setName("child"); 52 | 53 | myStruct->haxeRef = obj; 54 | obj->setName("Name"); 55 | 56 | api::HaxeObject *child = obj->createChild(); 57 | } 58 | 59 | 60 | if (!checkAttachNone("after interaction")) 61 | return -1; 62 | 63 | { 64 | hx::NativeAttach autoAttach; 65 | __hxcpp_collect(true); 66 | } 67 | 68 | if (!checkAttachNone("after collect")) 69 | return -1; 70 | 71 | { 72 | hx::NativeAttach autoAttach; 73 | if (myStruct->haxeRef->getName()!="Name") 74 | { 75 | printf("Could not get value back (%s)\n", myStruct->haxeRef->getName().c_str() ); 76 | return -1; 77 | } 78 | } 79 | 80 | { 81 | hx::NativeAttach autoAttach0; 82 | hx::NativeAttach autoAttach1; 83 | hx::NativeAttach autoAttach2; 84 | hx::NativeAttach autoAttach3; 85 | if (hx::GcGetThreadAttachedCount()!=4) 86 | { 87 | printf("Bad attach count\n"); 88 | return -1; 89 | } 90 | } 91 | 92 | if (!checkAttachNone("after clear")) 93 | return -1; 94 | 95 | printf("all good\n"); 96 | return 0; 97 | } 98 | 99 | -------------------------------------------------------------------------------- /test/haxe/TestIntHash.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | 4 | class TestIntHash extends Test 5 | { 6 | function spamAlot() 7 | { 8 | var values = new Array< Null >(); 9 | values[0] = null; 10 | var h = new Map(); 11 | 12 | for(i in 0...2000) 13 | { 14 | for(j in 0...2000) 15 | { 16 | var idx = Std.int(Math.random()*2999); 17 | if (h.get(idx)!=values[idx]) 18 | throw "Bad value"; 19 | if ( (i % 4)== 1 || Math.random()>0.5 ) 20 | { 21 | if (h.remove(idx) != (values[idx]!=null)) 22 | throw "Error in remove!"; 23 | values[idx] = null; 24 | } 25 | else 26 | { 27 | h.set(idx,j); 28 | values[idx] = j; 29 | } 30 | } 31 | var keys = h.keys(); 32 | var keyed = new Array(); 33 | for(i in 0...values.length) 34 | keyed[i] = false; 35 | for( key in h.keys()) 36 | keyed[ key ] = true; 37 | for(i in 0...values.length) 38 | if (keyed[i]!=(values[i]!=null)) 39 | throw "Bad value"; 40 | 41 | var valued = new Array(); 42 | for( val in h.iterator()) 43 | valued[val]++; 44 | 45 | for(val in values) 46 | if (val!=null) 47 | { 48 | if (valued[val]<1) 49 | throw "Not valued!"; 50 | valued[val]--; 51 | } 52 | } 53 | } 54 | 55 | public function test() 56 | { 57 | spamAlot(); 58 | 59 | Assert.pass(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /test/haxe/TestKeywords.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | 4 | private enum GnarlyEnum 5 | { 6 | e0; 7 | GnarlyEnum; 8 | narlyEnum; 9 | Dynamic; 10 | getFixed(i:Int); 11 | getInt; 12 | init(i:Int); 13 | String; 14 | index(i:Int); 15 | const; 16 | super(i:Int); 17 | tag(i:Int); 18 | getTag(i:Int); 19 | getObject(i:Int); 20 | } 21 | 22 | class TestKeywords extends Test 23 | { 24 | public function new() super(); 25 | 26 | //public function getGnarly() { return GnarlyEnum.super(1); } 27 | public function getGnarly() { return Dynamic; } 28 | 29 | public function testEnum() 30 | { 31 | var count = 32 | switch( getGnarly() ) 33 | { 34 | case e0: 1; 35 | //case GnarlyEnum: 1; 36 | case narlyEnum: 1; 37 | case Dynamic: 3; 38 | case getFixed(i): 1; 39 | case getInt: 1; 40 | case init(i): 1; 41 | case String: 1; 42 | case index(i): 1; 43 | case const: 1; 44 | //case GnarlyEnum.super(i): 2; 45 | case tag(i): 1; 46 | case getTag(i): 1; 47 | case getObject(i): 1; 48 | default: 0; 49 | } 50 | Assert.equals(3, count); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /test/haxe/TestMain.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | import utest.Runner; 4 | import utest.ui.Report; 5 | import gc.TestGC; 6 | 7 | class TestMain #if nme extends nme.display.Sprite #end { 8 | 9 | static function runTests():Int 10 | { 11 | var passes = 1; 12 | #if !nme 13 | var args = Sys.args(); 14 | if (args.length>0) 15 | passes = Std.parseInt(args[0]); 16 | #end 17 | 18 | final runner = new Runner(); 19 | runner.addCase(new TestTypes()); 20 | runner.addCase(new TestKeywords()); 21 | runner.addCase(new TestSort()); 22 | runner.addCase(new TestGC()); 23 | #if !nme 24 | runner.addCase(new gc.TestGCThreaded()); 25 | #end 26 | runner.addCase(new TestIntHash()); 27 | runner.addCase(new TestStringHash()); 28 | runner.addCase(new TestObjectHash()); 29 | runner.addCase(new TestWeakHash()); 30 | #if !nme 31 | runner.addCase(new file.TestFile()); 32 | #end 33 | 34 | #if cpp 35 | runner.addCase(new native.TestFinalizer()); 36 | #end 37 | 38 | final report = Report.create(runner); 39 | 40 | runner.run(); 41 | 42 | for(i in 0...passes) 43 | { 44 | var t0 = haxe.Timer.stamp(); 45 | runner.run(); 46 | trace(" Time : " + (haxe.Timer.stamp()-t0)*1000 ); 47 | } 48 | return 0; 49 | } 50 | 51 | #if nme 52 | var frameCount = 0; 53 | var tf:nme.text.TextField; 54 | public function new() 55 | { 56 | super(); 57 | tf = new nme.text.TextField(); 58 | tf.text="RUN..."; 59 | addChild(tf); 60 | addEventListener( nme.events.Event.ENTER_FRAME, onFrame ); 61 | } 62 | 63 | function onFrame(_) 64 | { 65 | var err = runTests(); 66 | tf.text = "" + (++frameCount); 67 | stage.opaqueBackground = err==0 ? 0xff00ff00: 0xffff0000; 68 | 69 | } 70 | 71 | #else 72 | public static function main() 73 | { 74 | utest.UTest.run([ 75 | new TestTypes(), 76 | new TestKeywords(), 77 | new TestSort(), 78 | new TestGC(), 79 | new gc.TestGCThreaded(), 80 | new TestIntHash(), 81 | new TestStringHash(), 82 | new TestObjectHash(), 83 | new TestWeakHash(), 84 | new file.TestFile(), 85 | new native.TestFinalizer() 86 | ]); 87 | } 88 | #end 89 | } 90 | 91 | 92 | -------------------------------------------------------------------------------- /test/haxe/TestObjectHash.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | 4 | class ObjectData 5 | { 6 | public var id:Int; 7 | public function new(inId:Int) id = inId; 8 | } 9 | 10 | class TestObjectHash extends Test 11 | { 12 | function spamAlot() 13 | { 14 | var values = new Array< Null >(); 15 | values[0] = null; 16 | var h = new Map(); 17 | var idxToKey = new Array(); 18 | for(idx in 0...3000) 19 | idxToKey[idx] = new ObjectData(idx); 20 | 21 | for(i in 0...2000) 22 | { 23 | for(j in 0...2000) 24 | { 25 | var idxInt = Std.int(Math.random()*2999); 26 | var idx = idxToKey[idxInt]; 27 | if (h.get(idx)!=values[idxInt]) 28 | { 29 | throw "Bad value"; 30 | } 31 | if ( (i % 4)== 1 || Math.random()>0.5 ) 32 | { 33 | if (h.remove(idx) != (values[idxInt]!=null)) 34 | { 35 | trace("Bad remove"); 36 | throw "Error in remove!"; 37 | } 38 | values[idxInt] = null; 39 | } 40 | else 41 | { 42 | h.set(idx,j); 43 | values[idxInt] = j; 44 | } 45 | } 46 | var keys = h.keys(); 47 | var keyed = new Array(); 48 | for(i in 0...values.length) 49 | keyed[i] = false; 50 | for( key in h.keys()) 51 | { 52 | var idxInt = key.id; 53 | keyed[ idxInt ] = true; 54 | } 55 | for(i in 0...values.length) 56 | if (keyed[i]!=(values[i]!=null)) 57 | throw "Bad value"; 58 | 59 | var valued = new Array(); 60 | #if neko 61 | valued[3000]=0; 62 | for(i in 0...3000) 63 | valued[i] = 0; 64 | #end 65 | for( val in h.iterator()) 66 | valued[val]++; 67 | 68 | for(val in values) 69 | if (val!=null) 70 | { 71 | if (valued[val]<1) 72 | throw "Not valued!"; 73 | valued[val]--; 74 | } 75 | } 76 | } 77 | 78 | public function test() 79 | { 80 | spamAlot(); 81 | 82 | Assert.pass(); 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /test/haxe/TestSort.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | 4 | class SortData 5 | { 6 | public var value:Int; 7 | public var id:Int; 8 | static var ids = 0; 9 | 10 | public function new() 11 | { 12 | value = Std.int(Math.random()*500); 13 | id = ids++; 14 | } 15 | } 16 | 17 | class TestSort extends Test 18 | { 19 | public function testObjects() 20 | { 21 | var tests = new Array(); 22 | for(i in 0...100000) 23 | tests.push( new SortData() ); 24 | 25 | var sorted = tests.copy(); 26 | sorted.sort( function(a,b) return a.value - b.value ); 27 | 28 | for(i in 1...sorted.length) 29 | { 30 | if (sorted[i].value < sorted[i-1].value) 31 | throw "Index out of order"; 32 | if (sorted[i].value == sorted[i-1].value && 33 | sorted[i].id <= sorted[i-1].id ) 34 | throw "Not stable sort"; 35 | } 36 | 37 | var sorted = tests.copy(); 38 | var compares = 0; 39 | sorted.sort( function(a,b) { 40 | // Churn some GC 41 | var array = new Array(); 42 | compares++; 43 | array.push(a.value); 44 | array.push(b.value); 45 | return array[0] < array[1] ? 1 : array[0] > array[1] ? -1 : 0; 46 | }); 47 | 48 | //Sys.println("\nCompares per log elements:" + (compares/(tests.length*Math.log(tests.length)))); 49 | 50 | for(i in 1...sorted.length) 51 | { 52 | if (sorted[i].value > sorted[i-1].value) 53 | throw "Index out of order"; 54 | if (sorted[i].value == sorted[i-1].value && 55 | sorted[i].id <= sorted[i-1].id ) 56 | throw "Not stable sort"; 57 | } 58 | 59 | Assert.pass(); 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /test/haxe/TestStringHash.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | 4 | class TestStringHash extends Test 5 | { 6 | function spamAlot() 7 | { 8 | var values = new Array< Null >(); 9 | values[0] = null; 10 | var h = new Map(); 11 | var idxToKey = new Array(); 12 | for(idx in 0...3000) 13 | idxToKey[idx] = Std.string(idx); 14 | 15 | for(i in 0...2000) 16 | { 17 | for(j in 0...2000) 18 | { 19 | var idxInt = Std.int(Math.random()*2999); 20 | var idx = idxToKey[idxInt]; 21 | if (h.get(idx)!=values[idxInt]) 22 | { 23 | throw "Bad value"; 24 | } 25 | if ( (i % 4)== 1 || Math.random()>0.5 ) 26 | { 27 | if (h.remove(idx) != (values[idxInt]!=null)) 28 | { 29 | trace("Bad remove"); 30 | throw "Error in remove!"; 31 | } 32 | values[idxInt] = null; 33 | } 34 | else 35 | { 36 | h.set(idx,j); 37 | values[idxInt] = j; 38 | } 39 | } 40 | var arr = [0,1,2]; 41 | var keys = h.keys(); 42 | // Empty allocations can mess with the GC nursery 43 | cpp.NativeArray.setSize(arr,0); 44 | cpp.NativeArray.setSize(arr,3); 45 | var keyed = new Array(); 46 | for(i in 0...values.length) 47 | keyed[i] = false; 48 | for( key in h.keys()) 49 | { 50 | var idxInt = Std.parseInt(key); 51 | keyed[ idxInt ] = true; 52 | } 53 | for(i in 0...values.length) 54 | if (keyed[i]!=(values[i]!=null)) 55 | throw "Bad value"; 56 | 57 | var valued = new Array(); 58 | #if neko 59 | valued[3000]=0; 60 | for(i in 0...3000) 61 | valued[i] = 0; 62 | #end 63 | for( val in h.iterator()) 64 | valued[val]++; 65 | 66 | for(val in values) 67 | if (val!=null) 68 | { 69 | if (valued[val]<1) 70 | throw "Not valued!"; 71 | valued[val]--; 72 | } 73 | } 74 | } 75 | 76 | public function test() 77 | { 78 | spamAlot(); 79 | 80 | Assert.pass(); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /test/haxe/TestTypes.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | 4 | class TestTypes extends Test 5 | { 6 | var i0:Int = 1; 7 | var i1:cpp.Int32 = 1; 8 | var i2:cpp.UInt32 = 1; 9 | var i3:cpp.Int64 = 1; 10 | var i4:cpp.UInt64 = 1; 11 | var i5:cpp.Int8 = 1; 12 | var i6:cpp.UInt8 = 1; 13 | var i7:cpp.Int16 = 1; 14 | var i8:cpp.UInt16 = 1; 15 | 16 | public function new() super(); 17 | 18 | function stringToCcs(string:String) : cpp.ConstCharStar 19 | { 20 | return string; 21 | } 22 | 23 | function ccsToString(ccs:cpp.ConstCharStar) : String 24 | { 25 | return ccs; 26 | } 27 | 28 | function ccsToStringCast(ccs:cpp.ConstCharStar) : String 29 | { 30 | return cast ccs; 31 | } 32 | 33 | public function testConstCharStar() 34 | { 35 | var ccs = stringToCcs("hello"); 36 | Assert.equals( ccsToString(ccs), "hello" ); 37 | Assert.equals( ccsToStringCast(ccs), "hello" ); 38 | } 39 | 40 | public function testDynamic() 41 | { 42 | var d:Dynamic = this; 43 | Assert.equals(d.i0, 1); 44 | Assert.equals(d.i1, 1); 45 | Assert.equals(d.i2, 1); 46 | Assert.equals(d.i3, 1); 47 | Assert.equals(d.i4, 1); 48 | Assert.equals(d.i5, 1); 49 | Assert.equals(d.i6, 1); 50 | Assert.equals(d.i7, 1); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /test/haxe/TestWeakHash.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | import haxe.ds.WeakMap; 4 | 5 | class WeakObjectData 6 | { 7 | public var id:Int; 8 | public function new(inId:Int) id = inId; 9 | public function toString() return "Data " + id; 10 | } 11 | 12 | class TestWeakHash extends Test 13 | { 14 | var retained:Array; 15 | 16 | function createMap(inCount:Int) 17 | { 18 | retained = []; 19 | var map = new WeakMap(); 20 | for(i in 0...inCount) 21 | { 22 | var obj = new WeakObjectData(i); 23 | if ( (i&1)==0 ) 24 | retained.push(obj); 25 | map.set(obj,i); 26 | } 27 | return map; 28 | } 29 | function createMapDeep(inDepth:Int, inCount:Int) 30 | { 31 | if (inDepth<1) 32 | return createMap(inCount); 33 | 34 | return createMapDeep(inDepth-1, inCount); 35 | } 36 | 37 | function checkMap(map:WeakMap, expect:Int) 38 | { 39 | var valid = 0; 40 | var oddFound = 0; 41 | for(k in map.keys()) 42 | { 43 | if( (k.id&1)!= 0) 44 | { 45 | oddFound ++; 46 | //throw "Odd retained " + k.id; 47 | } 48 | else 49 | valid++; 50 | } 51 | // There may be one or two values lurking on the stack, which is conservatively marked 52 | Assert.isTrue(oddFound<=2, "Too many odd values retained " + oddFound); 53 | Assert.isTrue(valid>=expect && valid, expect:Int) 56 | { 57 | if (inDepth<1) 58 | checkMap(map,expect); 59 | else 60 | deepCheckMap(inDepth-1, map, expect); 61 | } 62 | 63 | function deepClearRetained(inRecurse:Int) 64 | { 65 | if (inRecurse>0) 66 | deepClearRetained(inRecurse-1); 67 | else 68 | retained = []; 69 | } 70 | 71 | public function test() 72 | { 73 | final map = createMapDeep(20,1000); 74 | cpp.vm.Gc.run(true); 75 | deepCheckMap(10,map,500); 76 | deepClearRetained(10); 77 | cpp.vm.Gc.run(true); 78 | checkMap(map,0); 79 | 80 | Assert.pass(); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /test/haxe/compile.hxml: -------------------------------------------------------------------------------- 1 | -m TestMain 2 | -r TestMain.hx 3 | -D HXCPP_GC_GENERATIONAL 4 | -L utest 5 | --cpp bin 6 | -------------------------------------------------------------------------------- /test/haxe/compile_nme.nmml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /test/haxe/file/TestFile.hx: -------------------------------------------------------------------------------- 1 | package file; 2 | 3 | import utest.Test; 4 | import utest.Assert; 5 | 6 | class TestFile extends Test 7 | { 8 | public function testGetContentEmptyFile() 9 | { 10 | Assert.equals('', sys.io.File.getContent('./file/empty.txt')); 11 | } 12 | } -------------------------------------------------------------------------------- /test/haxe/file/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaxeFoundation/hxcpp/a428509569b8fa251f2317aa0fe9ed2de1927980/test/haxe/file/empty.txt -------------------------------------------------------------------------------- /test/haxe/gc/ZoneTest.cpp: -------------------------------------------------------------------------------- 1 | 2 | void nativeLoop() 3 | { 4 | while( gc::TestGCThreaded_obj::keepRunning) 5 | { 6 | 7 | for(int i=0; i<100; i++) 8 | ::gc::Wrapper_obj::__alloc( HX_CTX_GET ,1); 9 | 10 | ::Sys_obj::sleep(0.01); 11 | } 12 | gc::TestGCThreaded_obj::nativeRunning = false; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/native/Native.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | class Native 4 | { 5 | static function main() 6 | { 7 | utest.UTest.run([ 8 | new tests.TestStdio(), 9 | new tests.TestRgb(), 10 | new tests.TestRectangle(), 11 | new tests.TestGlobalNamespace(), 12 | new tests.TestNativeGen(), 13 | new tests.TestNonVirtual(), 14 | new tests.TestPtr(), 15 | new tests.TestNativeEnum() 16 | ]); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/native/NativeGen.hx: -------------------------------------------------------------------------------- 1 | 2 | @:nativeGen 3 | @:structAccess 4 | class NativeGen 5 | { 6 | public var x:Float; 7 | public static var y:Int; 8 | public function getValue():Float return x; 9 | 10 | public static function someNativeFunction() 11 | { 12 | trace("Hi!"); 13 | } 14 | } 15 | 16 | @:native("cpp::Struct") 17 | @:include("NativeGen.h") 18 | extern class NativeGenStruct extends NativeGen 19 | { 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/native/compile.hxml: -------------------------------------------------------------------------------- 1 | -m Native 2 | -D HXCPP_DEBUGGER 3 | -L utest 4 | --cpp bin -------------------------------------------------------------------------------- /test/native/externs/RGB.hx: -------------------------------------------------------------------------------- 1 | package externs; 2 | 3 | import cpp.UInt8; 4 | import cpp.Pointer; 5 | 6 | @:include("./../lib/LibInclude.h") 7 | @:sourceFile("./../lib/RGB.cpp") 8 | @:native("RGB") 9 | extern class RGB 10 | { 11 | public var r:UInt8; 12 | public var g:UInt8; 13 | public var b:UInt8; 14 | 15 | public function getLuma():Int; 16 | public function toInt():Int; 17 | 18 | @:native("new RGB") 19 | public static function create(r:Int, g:Int, b:Int):Pointer; 20 | 21 | @:native("~RGB") 22 | public function deleteMe():Void; 23 | } 24 | 25 | 26 | 27 | // By extending RGB we keep the same API as far as haxe is concerned, but store the data (not pointer) 28 | // The native Reference class knows how to take the reference to the structure 29 | @:native("cpp.Reference") 30 | extern class RGBRef extends RGB 31 | { 32 | } 33 | 34 | 35 | 36 | // By extending RGBRef, we can keep the same api, 37 | // rather than a pointer 38 | @:native("cpp.Struct") 39 | extern class RGBStruct extends RGBRef 40 | { 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test/native/externs/Rectangle.hx: -------------------------------------------------------------------------------- 1 | package externs; 2 | 3 | import externs.RectangleApi; 4 | 5 | @:include("./RectangleDef.h") 6 | @:structAccess 7 | @:native("Rectangle") 8 | extern class Rectangle 9 | { 10 | @:native("Rectangle::instanceCount") 11 | static var instanceCount:Int; 12 | 13 | public var x:Int; 14 | public var y:Int; 15 | public var width:Int; 16 | public var height:Int; 17 | 18 | public function area() : Int; 19 | 20 | @:native("new Rectangle") 21 | @:overload( function():cpp.Star{} ) 22 | @:overload( function(x:Int):cpp.Star{} ) 23 | @:overload( function(x:Int, y:Int):cpp.Star{} ) 24 | @:overload( function(x:Int, y:Int, width:Int):cpp.Star{} ) 25 | static function create(x:Int, y:Int, width:Int, height:Int):cpp.Star; 26 | 27 | @:native("Rectangle") 28 | @:overload( function():Rectangle {} ) 29 | @:overload( function(x:Int):Rectangle {} ) 30 | @:overload( function(x:Int, y:Int):Rectangle {} ) 31 | @:overload( function(x:Int, y:Int, width:Int):Rectangle {} ) 32 | static function make(x:Int, y:Int, width:Int, height:Int):Rectangle; 33 | 34 | @:native("~Rectangle") 35 | public function delete():Void; 36 | } 37 | 38 | typedef RectanglePtr = cpp.Star; 39 | -------------------------------------------------------------------------------- /test/native/externs/RectangleApi.hx: -------------------------------------------------------------------------------- 1 | package externs; 2 | 3 | // This class acts as a container for the Rectangle implementation, which will get included 4 | // in the cpp file, and therfore get compiled and linked with the correct flags 5 | @:cppInclude("./RectangleImpl.cpp") 6 | @:keep 7 | class RectangleApi 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /test/native/externs/RectangleDef.h: -------------------------------------------------------------------------------- 1 | #ifndef RECTANGLE_DEF_INCLUDED 2 | #define RECTANGLE_DEF_INCLUDED 3 | 4 | struct Rectangle 5 | { 6 | static int instanceCount; 7 | 8 | int x; 9 | int y; 10 | int width; 11 | int height; 12 | 13 | inline Rectangle(int inX=0, int inY=0, int inW=0, int inH=0) : 14 | x(inX), y(inY), width(inW), height(inH) 15 | { 16 | instanceCount++; 17 | } 18 | inline ~Rectangle() 19 | { 20 | instanceCount--; 21 | } 22 | 23 | int area(); 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /test/native/externs/RectangleImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "RectangleDef.h" 2 | 3 | int Rectangle::instanceCount = 0; 4 | 5 | int Rectangle::area() 6 | { 7 | return width*height; 8 | } 9 | -------------------------------------------------------------------------------- /test/native/externs/ShortPtr.hx: -------------------------------------------------------------------------------- 1 | package externs; 2 | 3 | @:native("short *") @:unreflective 4 | extern class ShortPtr { } 5 | -------------------------------------------------------------------------------- /test/native/lib/LibInclude.h: -------------------------------------------------------------------------------- 1 | #ifndef LIB_INCLUDE_INCLUDED 2 | #define LIB_INCLUDE_INCLUDED 3 | 4 | struct RGB 5 | { 6 | unsigned char r; 7 | unsigned char g; 8 | unsigned char b; 9 | 10 | 11 | RGB(int inR=0, int inG=0, int inB=0) : 12 | r(inR), g(inG), b(inB) 13 | { 14 | } 15 | 16 | int getLuma(); 17 | int toInt(); 18 | }; 19 | 20 | struct Gradient 21 | { 22 | RGB colour0; 23 | RGB colour1; 24 | int steps; 25 | }; 26 | 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /test/native/lib/RGB.cpp: -------------------------------------------------------------------------------- 1 | #include "LibInclude.h" 2 | 3 | int RGB::getLuma() { return (r+g+b)/3; } 4 | 5 | int RGB::toInt() { return (r<<16) | (g<<8) | b; } 6 | -------------------------------------------------------------------------------- /test/native/tests/TestGlobalNamespace.hx: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import utest.Test; 4 | import utest.Assert; 5 | 6 | class TestGlobalNamespace extends Test 7 | { 8 | var shortPtr:externs.ShortPtr; 9 | 10 | public function testGen() 11 | { 12 | Assert.pass(); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /test/native/tests/TestNativeEnum.hx: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import utest.Test; 4 | import utest.Assert; 5 | 6 | // Uses native enum, which does not play nice with Dynamic - must use @:unreflective 7 | @:unreflective 8 | #if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SystemMetric(SystemMetricImpl) { 9 | @:native("wxSYS_MOUSE_BUTTONS") var MOUSE_BUTTONS; 10 | @:native("wxSYS_OS") var OS; 11 | } 12 | @:unreflective 13 | @:native("wxSystemMetric") 14 | extern class SystemMetricImpl { } 15 | 16 | 17 | 18 | // Wraps enum in struct, which does play nice... 19 | #if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SystemMetricStruct(SystemMetricStructImpl) { 20 | @:native("wxSYS_MOUSE_BUTTONS") var MOUSE_BUTTONS; 21 | @:native("wxSYS_OS") var OS; 22 | } 23 | @:native("cpp::Struct") 24 | extern class SystemMetricStructImpl { } 25 | 26 | @:headerCode(' 27 | enum wxSystemMetric 28 | { 29 | wxSYS_OS = 3, 30 | wxSYS_MOUSE_BUTTONS = 27, 31 | }; 32 | ') 33 | class TestNativeEnum extends Test 34 | { 35 | var x:SystemMetric = SystemMetric.MOUSE_BUTTONS; 36 | var xStruct:SystemMetricStruct = SystemMetricStruct.MOUSE_BUTTONS; 37 | 38 | function isX(val:SystemMetric) 39 | { 40 | return (val==x); 41 | } 42 | 43 | function isXStruct(val:SystemMetricStruct) 44 | { 45 | return (val==xStruct); 46 | } 47 | 48 | 49 | public function test() 50 | { 51 | Assert.isTrue( isX(SystemMetric.MOUSE_BUTTONS)==true ); 52 | Assert.isTrue( isX(SystemMetric.OS)==false ); 53 | Assert.isTrue( isXStruct(SystemMetricStruct.MOUSE_BUTTONS)==true ); 54 | Assert.isTrue( isXStruct(SystemMetricStruct.OS)==false ); 55 | var d:Dynamic = this; 56 | Assert.isNull( d.x ); 57 | Assert.notNull( d.xStruct ); 58 | Assert.isNull( d.isX ); 59 | Assert.notNull( d.isXStruct ); 60 | var func: (SystemMetricStruct)->Bool = d.isXStruct; 61 | Assert.notNull(func); 62 | Assert.isTrue(func(SystemMetricStruct.MOUSE_BUTTONS)==true ); 63 | Assert.isTrue(func(SystemMetricStruct.OS)==false ); 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /test/native/tests/TestNativeGen.hx: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import NativeGen; 4 | import utest.Test; 5 | import utest.Assert; 6 | 7 | class TestNativeGen extends Test 8 | { 9 | @:unreflective var unreflectiveValue:NativeGen; 10 | 11 | @:unreflective public function unreflectiveFunction(inGen:NativeGen) 12 | { 13 | unreflectiveValue = inGen; 14 | return unreflectiveValue.x==22; 15 | } 16 | 17 | public function testCreate() 18 | { 19 | var nGen:NativeGenStruct = null; 20 | nGen.x = 22; 21 | Assert.equals(22f64, nGen.getValue()); 22 | Assert.isTrue(unreflectiveFunction(nGen)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/native/tests/TestNonVirtual.hx: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import utest.Test; 4 | import utest.Assert; 5 | 6 | class Base 7 | { 8 | public function new() {} 9 | 10 | @:nonVirtual public function getNvName() return "Base"; 11 | public function getName() return "Base"; 12 | } 13 | 14 | 15 | class Derived extends Base 16 | { 17 | @:nonVirtual override public function getNvName() return "Derived"; 18 | override public function getName() return "Derived"; 19 | } 20 | 21 | 22 | class TestNonVirtual extends Test 23 | { 24 | public function testOverride() 25 | { 26 | var derived = new Derived(); 27 | 28 | Assert.equals( "Derived", derived.getName() ); 29 | Assert.equals( "Derived", derived.getNvName() ); 30 | var closure:Dynamic = derived.getNvName; 31 | Assert.equals( "Derived", closure() ); 32 | 33 | var base:Base = derived; 34 | 35 | Assert.equals( "Derived", base.getName()); 36 | Assert.equals( "Base", base.getNvName() ); 37 | var closure:Dynamic = base.getNvName; 38 | Assert.equals( "Base", closure() ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/native/tests/TestRgb.hx: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import utest.Test; 4 | import utest.Assert; 5 | import externs.RGB; 6 | 7 | class TestRgb extends Test 8 | { 9 | public function testCreate() 10 | { 11 | // Pointer-like sysntax 12 | var rgbPtr = RGB.create(255,0,128); 13 | Assert.equals( rgbPtr.ptr.toInt(), 0xff0080 ); 14 | rgbPtr.ptr.deleteMe(); 15 | 16 | 17 | // Structure-like syntax 18 | var rgbStruct:RGBStruct = null; 19 | rgbStruct.r = 1; 20 | rgbStruct = null; 21 | rgbStruct.r = 1; 22 | rgbStruct.g = 2; 23 | rgbStruct.b = 3; 24 | Assert.equals( rgbStruct.toInt(), 0x010203 ); 25 | // Store in dynamic 26 | var d:Dynamic = rgbStruct; 27 | 28 | // Reference (pointer) like syntax 29 | var rgbRef:RGBRef = rgbStruct; 30 | rgbRef.g = 255; 31 | Assert.equals( rgbStruct.toInt(), 0x01ff03 ); 32 | 33 | // Get from dynamic 34 | rgbStruct = d; 35 | Assert.equals( rgbStruct.toInt(), 0x010203 ); 36 | 37 | var rgbStruct2:RGBStruct = cast rgbRef; 38 | Assert.equals( rgbStruct2.toInt(), 0x010203 ); 39 | 40 | // Reference refers to rgbStruct, not rgbStruct2 41 | rgbRef.b = 0; 42 | Assert.equals( rgbStruct2.toInt(), 0x010203 ); 43 | Assert.equals( rgbStruct.toInt(), 0x010200 ); 44 | 45 | 46 | // TODO - non-dynamic versions 47 | var d2:Dynamic = rgbStruct2; 48 | // == dynamic 49 | Assert.equals( d2, d ); 50 | // != dynamic 51 | var d0:Dynamic = rgbStruct; 52 | Assert.notEquals( d0, d ); 53 | 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /test/native/tests/TestStdio.hx: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | import utest.Test; 4 | import utest.Assert; 5 | import cpp.Stdio; 6 | 7 | using cpp.NativeArray; 8 | 9 | class TestStdio extends Test 10 | { 11 | public function test() 12 | { 13 | var file = Stdio.fopen("test.txt", "wb"); 14 | var ints = [1]; 15 | var size:cpp.SizeT = cpp.Stdlib.sizeof(Int); 16 | Stdio.fwrite( ints.address(0).raw, size, 1, file ); 17 | Stdio.fclose(file); 18 | 19 | var bytes = sys.io.File.getBytes("test.txt"); 20 | var input = new haxe.io.BytesInput(bytes); 21 | var val = input.readInt32(); 22 | 23 | Assert.equals(val, ints[0]); 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /test/snippets/messagebox/MessageBox.hx: -------------------------------------------------------------------------------- 1 | import cpp.*; 2 | 3 | // Windows only. 4 | // Compile with "-D no_console" for best effect 5 | 6 | @:cppFileCode("#include ") 7 | class MessageBox 8 | { 9 | public static function main() 10 | { 11 | var messageBox:cpp.Function< Pointer< Void > -> 12 | ConstCharStar -> 13 | ConstCharStar -> 14 | Int -> Int, cpp.abi.Winapi > = 15 | Function.getProcAddress("User32.dll", "MessageBoxA"); 16 | 17 | messageBox(null, "Hello, World!", "Hxcpp MessageBox", 0); 18 | 19 | // This will actually print out if you have started from a console (not double-click) 20 | trace("Sneaky trace"); 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /test/snippets/messagebox/compile.hxml: -------------------------------------------------------------------------------- 1 | -main MessageBox 2 | -cpp cpp 3 | -D no_console 4 | -cmd start cpp/MessageBox.exe 5 | -------------------------------------------------------------------------------- /test/std/Test.nmml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test/std/compile32.hxml: -------------------------------------------------------------------------------- 1 | -m Test 2 | -D HXCPP_M32 3 | -D HXCPP_DEBUGGER 4 | -L hx4compat 5 | -L utest 6 | --cpp cpp32 -------------------------------------------------------------------------------- /test/std/compile64.hxml: -------------------------------------------------------------------------------- 1 | -m Test 2 | -D HXCPP_M64 3 | -L hx4compat 4 | -L utest 5 | --cpp cpp64 -------------------------------------------------------------------------------- /test/std/compileArm64.hxml: -------------------------------------------------------------------------------- 1 | -m Test 2 | -D HXCPP_ARM64 3 | -L hx4compat 4 | -L utest 5 | --cpp arm64 6 | -------------------------------------------------------------------------------- /test/std/testAndroid.hxml: -------------------------------------------------------------------------------- 1 | -m Test 2 | -D android 3 | -D exe_link 4 | -L hx4compat 5 | -L utest 6 | --cmd adb push arm32/Test /storage/ext_sd 7 | --cmd adb push Test.hx /storage/ext_sd 8 | --cmd adb shell "cd /storage/ext_sd && ./Test" 9 | --cpp arm32 -------------------------------------------------------------------------------- /test/telemetry/TestBasic.hx: -------------------------------------------------------------------------------- 1 | import utest.Test; 2 | import utest.Assert; 3 | 4 | class TestBasic extends Test 5 | { 6 | function testStartTelemetry() 7 | { 8 | var thread_id:Int = startTelemetry(true, true); 9 | Assert.isTrue(thread_id>=0); 10 | } 11 | 12 | function startTelemetry(with_profiler:Bool=true, 13 | with_allocations:Bool=true):Int 14 | { 15 | // Compile will fail without -D HXCPP_TELEMETRY 16 | return untyped __global__.__hxcpp_hxt_start_telemetry(with_profiler, 17 | with_allocations); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /test/telemetry/TestMain.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | class TestMain { 4 | 5 | static function main(){ 6 | utest.UTest.run([ new TestBasic() ]); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/telemetry/compile.hxml: -------------------------------------------------------------------------------- 1 | -m TestMain 2 | -r TestMain.hx 3 | -D HXCPP_TELEMETRY 4 | -D HXCPP_STACK_TRACE 5 | -L utest 6 | --cpp bin -------------------------------------------------------------------------------- /test/telemetry/test.bat: -------------------------------------------------------------------------------- 1 | haxe compile.hxml 2 | "bin/TestMain.exe" -------------------------------------------------------------------------------- /test/threads/Test.hx: -------------------------------------------------------------------------------- 1 | import sys.thread.Thread; 2 | import sys.io.File; 3 | 4 | @:cppInclude("./ThreadCode.cpp") 5 | class Test 6 | { 7 | static var mainThread:Thread; 8 | 9 | @:native("runThread") 10 | extern static function createNativeThread():Void; 11 | 12 | public static function callFromThread() 13 | { 14 | trace("Same:" + (mainThread==Thread.current()) ); 15 | mainThread.sendMessage("Done"); 16 | } 17 | 18 | public static function main() 19 | { 20 | var me = Thread.current(); 21 | mainThread = me; 22 | Thread.create( function() { 23 | File.copy("a.txt","b.txt"); 24 | me.sendMessage("Done"); 25 | trace("Same thread:" + (me==Thread.current()) ); 26 | } ); 27 | var result = Thread.readMessage(true); 28 | trace(result); 29 | 30 | for(x in 0...20) 31 | { 32 | trace("call..."); 33 | createNativeThread(); 34 | trace("zzz..."); 35 | Sys.sleep(1); 36 | var result = Thread.readMessage(true); 37 | trace(result); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/threads/ThreadCode.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | THREAD_FUNC_TYPE threadFunc(void *data) 5 | { 6 | printf("In thread\n"); 7 | hx::NativeAttach attach; 8 | Test_obj::callFromThread(); 9 | THREAD_FUNC_RET 10 | } 11 | 12 | void runThread() 13 | { 14 | HxCreateDetachedThread(threadFunc,nullptr); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /test/threads/a.txt: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /test/threads/compile.hxml: -------------------------------------------------------------------------------- 1 | -m Test 2 | --cpp cpp 3 | --debug -------------------------------------------------------------------------------- /toolchain/android-toolchain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /toolchain/cygwin-toolchain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /toolchain/dospath.bat: -------------------------------------------------------------------------------- 1 | @for %%I in (.) do @echo %%~sI 2 | -------------------------------------------------------------------------------- /toolchain/gcc-toolchain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 32 | 33 | 34 |
35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
60 | -------------------------------------------------------------------------------- /toolchain/msvc-arm64-setup.bat: -------------------------------------------------------------------------------- 1 | setlocal enabledelayedexpansion 2 | @if exist "%HXCPP_MSVC%\..\..\VC\" ( 3 | @if not exist "%hxcpp_msvc%\..\..\VC\Auxiliary\Build\vcvars%msvc_host_arch%_arm64.bat" ( 4 | @echo Error: the specified MSVC version does not have vcvars%msvc_host_arch%_arm64.bat setup script 5 | ) else ( 6 | @echo "%HXCPP_MSVC%" 7 | @call "%HXCPP_MSVC%\..\..\VC\Auxiliary\Build\vcvars%msvc_host_arch%_amd64.bat" 8 | @echo HXCPP_VARS 9 | @set 10 | ) 11 | ) else if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( 12 | for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.arm64 -property installationPath`) do ( 13 | @set InstallDir=%%i 14 | ) 15 | @if exist "!InstallDir!\Common7\Tools\VsDevCmd.bat" ( 16 | @call "!InstallDir!\Common7\Tools\VsDevCmd.bat" -host_arch=%msvc_host_arch% -arch=arm64 -app_platform=Desktop -no_logo 17 | @echo HXCPP_VARS 18 | @set 19 | ) else ( 20 | echo Warning: Could not find Visual Studio VsDevCmd 21 | ) 22 | ) else ( 23 | echo Error: arm64 is not automatically supported for this version of VC. 24 | ) 25 | -------------------------------------------------------------------------------- /toolchain/msvc-winrt-setup.bat: -------------------------------------------------------------------------------- 1 | setlocal enabledelayedexpansion 2 | @if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( 3 | for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( 4 | @set InstallDir=%%i 5 | ) 6 | @if exist "!InstallDir!\Common7\Tools\VsDevCmd.bat" ( 7 | @call "!InstallDir!\Common7\Tools\VsDevCmd.bat" -arch=x86 -app_platform=UWP -no_logo 8 | @set "LIB=%VCTOOLSINSTALLDIR%lib\x86\store;%WindowsSdkDir%Lib\%WindowsSDKLibVersion%um\x86;!LIB!" 9 | @set "LIBPATH=%VCTOOLSINSTALLDIR%lib\x86\store\references;!LIBPATH!" 10 | @echo HXCPP_VARS 11 | @set 12 | ) else ( 13 | echo Warning: Could not find Visual Studio VsDevCmd 14 | ) 15 | ) else if exist "%VS140COMNTOOLS%\vsvars32.bat" ( 16 | @call "%VS140COMNTOOLS%\vsvars32.bat" 17 | @set "INCLUDE=%WindowsSdkDir%Include;!INCLUDE!" 18 | @set "PATH=%WindowsSdkDir%bin\x86;!PATH!" 19 | @set "LIB=%WindowsSdkDir%Lib\%WindowsSDKLibVersion%um\x86;!LIB!" 20 | @set "LIBPATH=%VS140COMNTOOLS%\..\..\VC\lib\store\references;!LIBPATH!" 21 | @echo HXCPP_VARS 22 | @set 23 | ) else ( 24 | echo Warning: Could not find x64 environment variables for Visual Studio compiler 25 | ) 26 | -------------------------------------------------------------------------------- /toolchain/msvc-winrt64-setup.bat: -------------------------------------------------------------------------------- 1 | setlocal enabledelayedexpansion 2 | @if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( 3 | for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( 4 | @set InstallDir=%%i 5 | ) 6 | @if exist "!InstallDir!\Common7\Tools\VsDevCmd.bat" ( 7 | @call "!InstallDir!\Common7\Tools\VsDevCmd.bat" -arch=amd64 -app_platform=UWP -no_logo 8 | @set "LIB=%VCTOOLSINSTALLDIR%lib\x64\store;%WindowsSdkDir%Lib\%WindowsSDKLibVersion%um\x64;!LIB!" 9 | @set "LIBPATH=%VCTOOLSINSTALLDIR%lib\x86\store\references;!LIBPATH!" 10 | @echo HXCPP_VARS 11 | @set 12 | @echo HXCPP_HACK_PDBSRV=1 13 | ) else ( 14 | echo Warning: Could not find Visual Studio VsDevCmd 15 | ) 16 | ) else if exist "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" ( 17 | @call "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" 18 | @set "INCLUDE=%WindowsSdkDir%Include;!INCLUDE!" 19 | @set "PATH=%WindowsSdkDir%bin\x64;!PATH!" 20 | @set "LIB=%WindowsSdkDir%Lib\%WindowsSDKLibVersion%um\x64;!LIB!" 21 | @set "LIBPATH=%VS140COMNTOOLS%\..\..\VC\lib\store\references;!LIBPATH!" 22 | @echo HXCPP_VARS 23 | @set 24 | @echo HXCPP_HACK_PDBSRV=1 25 | ) else ( 26 | echo Warning: Could not find x64 environment variables for Visual Studio compiler 27 | ) 28 | -------------------------------------------------------------------------------- /toolchain/msvc64-setup.bat: -------------------------------------------------------------------------------- 1 | setlocal enabledelayedexpansion 2 | @if exist "%HXCPP_MSVC%\..\..\VC\" ( 3 | @if not exist "%HXCPP_MSVC%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" ( 4 | @echo Error: the specified MSVC version does not have vcvarsx86_amd64.bat setup script 5 | ) else ( 6 | @echo "%HXCPP_MSVC%" 7 | @call "%HXCPP_MSVC%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" 8 | @echo HXCPP_VARS 9 | @set 10 | ) 11 | exit 12 | ) 13 | @if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( 14 | for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( 15 | @set InstallDir=%%i 16 | ) 17 | @if exist "!InstallDir!\Common7\Tools\VsDevCmd.bat" ( 18 | @call "!InstallDir!\Common7\Tools\VsDevCmd.bat" -arch=amd64 -app_platform=Desktop -no_logo 19 | @echo HXCPP_VARS 20 | @set 21 | exit 22 | ) else ( 23 | echo Warning: Could not find Visual Studio VsDevCmd 24 | ) 25 | ) 26 | @if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" ( 27 | @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -app_platform=Desktop -no_logo 28 | @echo HXCPP_VARS 29 | @set 30 | ) else if exist "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" ( 31 | @echo "%VS140COMNTOOLS%" 32 | @call "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" 33 | @echo HXCPP_VARS 34 | @set 35 | @echo HXCPP_HACK_PDBSRV=1 36 | ) else if exist "%VS120COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" ( 37 | @echo "%VS120COMNTOOLS%" 38 | @call "%VS120COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" 39 | @echo HXCPP_VARS 40 | @set 41 | ) else if exist "%VS110COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" ( 42 | @echo "%VS110COMNTOOLS%" 43 | @call "%VS110COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" 44 | @echo HXCPP_VARS 45 | @set 46 | ) else ( 47 | echo Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths 48 | ) -------------------------------------------------------------------------------- /toolchain/nvcc-setup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /toolchain/setup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /toolchain/webos-toolchain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /tools/azure-pipelines/build.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaxeFoundation/hxcpp/a428509569b8fa251f2317aa0fe9ed2de1927980/tools/azure-pipelines/build.yml -------------------------------------------------------------------------------- /tools/build/Build.hx: -------------------------------------------------------------------------------- 1 | class Build extends hxcpp.Builder 2 | { 3 | // Create a build in 'bin' directory, with the "stdlibc++" flags for compatibility 4 | // This flasg should not make a difference because hxcpp does not use stdlibc++ 5 | override public function wantLegacyIosBuild() { return true; } 6 | 7 | override public function wantWindows64() { return true; } 8 | 9 | 10 | // Override to ensure this version if hxcpp is used, even if haxelib says otherwise 11 | override public function runBuild(target:String, isStatic:Bool, arch:String, inFlags:Array) 12 | { 13 | var args = ["run.n", "Build.xml"].concat(inFlags); 14 | var here = Sys.getCwd().split("\\").join("/"); 15 | 16 | var parts = here.split("/"); 17 | if (parts.length>0 && parts[parts.length-1]=="") 18 | parts.pop(); 19 | if (parts.length>0) 20 | parts.pop(); 21 | var hxcppDir = parts.join("/"); 22 | 23 | // This is how haxelib calls a 'run.n' script... 24 | Sys.setCwd(hxcppDir); 25 | args.push(here); 26 | Sys.println("neko " + args.join(" ")); 27 | if (Sys.command("neko",args)!=0) 28 | { 29 | Sys.println("#### Error building neko " + inFlags.join(" ")); 30 | Sys.exit(-1); 31 | } 32 | Sys.setCwd(here); 33 | } 34 | 35 | public static function main() 36 | { 37 | new Build( Sys.args() ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tools/build/compile.hxml: -------------------------------------------------------------------------------- 1 | -neko ../../project/build.n 2 | -main Build 3 | -D neko_v1 4 | -lib hxcpp 5 | -debug 6 | -------------------------------------------------------------------------------- /tools/haxe/build_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | git clone --recursive https://github.com/HaxeFoundation/haxe.git ~/haxe --depth 1 5 | 6 | sudo add-apt-repository ppa:avsm/ppa -y 7 | sudo add-apt-repository ppa:haxe/snapshots -y 8 | sudo apt-get update 9 | sudo apt-get install -y \ 10 | neko \ 11 | ocaml-nox \ 12 | camlp4-extra \ 13 | opam \ 14 | libpcre3-dev \ 15 | zlib1g-dev \ 16 | awscli 17 | 18 | export OPAMYES=1 19 | opam init 20 | eval `opam config env` 21 | opam pin add haxe ~/haxe --no-action 22 | opam install haxe --deps-only 23 | 24 | # Build haxe 25 | pushd ~/haxe 26 | make ADD_REVISION=1 && sudo make install INSTALL_DIR=/usr/local 27 | popd 28 | haxe -version 29 | # setup haxelib 30 | mkdir ~/haxelib && haxelib setup ~/haxelib 31 | haxelib dev hxcpp $TRAVIS_BUILD_DIR 32 | haxelib install record-macros 33 | -------------------------------------------------------------------------------- /tools/haxe/build_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | git clone --recursive https://github.com/HaxeFoundation/haxe.git ~/haxe --depth 1 5 | 6 | brew update 7 | brew tap Homebrew/bundle 8 | brew bundle --file=~/haxe/tests/Brewfile --no-upgrade 9 | 10 | brew install neko --HEAD; 11 | 12 | export OPAMYES=1 13 | opam init 14 | eval `opam config env` 15 | opam update 16 | opam pin add haxe ~/haxe --no-action 17 | opam install haxe --deps-only 18 | 19 | # Build haxe 20 | pushd ~/haxe 21 | make ADD_REVISION=1 && sudo make install INSTALL_DIR=/usr/local 22 | popd 23 | haxe -version 24 | # setup haxelib 25 | mkdir ~/haxelib && haxelib setup ~/haxelib 26 | haxelib dev hxcpp $TRAVIS_BUILD_DIR 27 | haxelib install record-macros 28 | 29 | -------------------------------------------------------------------------------- /tools/hxcpp/HLSL.hx: -------------------------------------------------------------------------------- 1 | import haxe.io.Path; 2 | import sys.FileSystem; 3 | 4 | class HLSL 5 | { 6 | var file:String; 7 | var profile:String; 8 | var target:String; 9 | var variable:String; 10 | 11 | public function new(inFile:String, inProfile:String, inVariable:String, inTarget:String) 12 | { 13 | file = inFile; 14 | profile = inProfile; 15 | variable = inVariable; 16 | target = inTarget; 17 | } 18 | 19 | public function build() 20 | { 21 | if (!FileSystem.exists(Path.directory (target))) 22 | { 23 | PathManager.mkdir(Path.directory (target)); 24 | } 25 | 26 | //DirManager.makeFileDir(target); 27 | 28 | var srcStamp = FileSystem.stat(file).mtime.getTime(); 29 | if (!FileSystem.exists(target) || FileSystem.stat(target).mtime.getTime() < srcStamp) 30 | { 31 | var exe = "fxc.exe"; 32 | var args = [ "/nologo", "/T", profile, file, "/Vn", variable, "/Fh", target ]; 33 | 34 | var result = ProcessManager.runCommand("", exe, args); 35 | if (result!=0) 36 | { 37 | Log.error("Could not compile shader \"" + file + "\""); 38 | //throw "Error : Could not compile shader " + file + " - build cancelled"; 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /tools/hxcpp/Manifester.hx: -------------------------------------------------------------------------------- 1 | class Manifester 2 | { 3 | public var mExe:String; 4 | public var mFlags:Array; 5 | public var mOutPre:String; 6 | public var mOutPost:String; 7 | 8 | public function new(inExe:String) 9 | { 10 | mFlags = []; 11 | mExe = inExe; 12 | mOutPre = ""; 13 | mOutPost = ""; 14 | } 15 | 16 | public function add(binName:String,manifestName:String, isExe:Bool) 17 | { 18 | var args = new Array(); 19 | args = args.concat(mFlags); 20 | 21 | //only windows for now 22 | mOutPost = isExe ? ";1" : ";2"; 23 | 24 | var result = ProcessManager.runCommand("", mExe, args.concat([manifestName,mOutPre + binName + mOutPost]) ); 25 | if (result!=0) 26 | { 27 | Tools.exit(result); 28 | //throw "Error : " + result + " - build cancelled"; 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /tools/hxcpp/Stripper.hx: -------------------------------------------------------------------------------- 1 | class Stripper 2 | { 3 | public var mExe:String; 4 | public var mFlags:Array; 5 | 6 | public function new(inExe:String) 7 | { 8 | mFlags = []; 9 | mExe = inExe; 10 | } 11 | 12 | public function strip(inTarget:String) 13 | { 14 | var args = new Array(); 15 | args = args.concat(mFlags); 16 | args.push(inTarget); 17 | 18 | var split = mExe.split(" "); 19 | var exe = split.shift(); 20 | args = split.concat(args); 21 | 22 | var result = ProcessManager.runCommand("", exe, args); 23 | if (result!=0) 24 | { 25 | Tools.exit(result); 26 | //throw "Error : " + result + " - build cancelled"; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tools/hxcpp/Tools.hx: -------------------------------------------------------------------------------- 1 | class Tools { 2 | private static var onExit:ArrayVoid> = []; 3 | 4 | public static function addOnExitHook(fn:Int->Void) { 5 | onExit.push(fn); 6 | } 7 | 8 | public static function exit(exitCode:Int) { 9 | for (hook in onExit) { 10 | hook(exitCode); 11 | } 12 | Sys.exit(exitCode); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tools/hxcpp/compile-cpp.hxml: -------------------------------------------------------------------------------- 1 | -cpp cpp 2 | -main BuildTool 3 | -D HXCPP_STACK_TRACE 4 | -D HXCPP_STACK_LINE 5 | -D HXCPP_NEKO_BUILDTOOL=1 6 | -D destination=../../../bin/{BINDIR}/BuildTool{EXESUFFIX} 7 | -------------------------------------------------------------------------------- /tools/hxcpp/compile.hxml: -------------------------------------------------------------------------------- 1 | -neko ../../hxcpp.n 2 | -main BuildTool 3 | -D neko_v1 4 | -debug 5 | -------------------------------------------------------------------------------- /tools/run/compile.hxml: -------------------------------------------------------------------------------- 1 | -neko ../../run.n 2 | -main RunMain 3 | -D neko_v1 4 | -debug 5 | -------------------------------------------------------------------------------- /tools/version/Write.hx: -------------------------------------------------------------------------------- 1 | import haxe.Exception; 2 | import haxe.Json; 3 | import sys.io.File; 4 | 5 | using StringTools; 6 | 7 | typedef Haxelib = { 8 | var version: String; 9 | } 10 | 11 | class Write 12 | { 13 | public static function main() 14 | { 15 | switch Sys.args() 16 | { 17 | case [ version ] if (version.startsWith('v')): 18 | switch version.substr(1).split('.') 19 | { 20 | case [ previousMajor, previousMinor, previousPatch ]: 21 | final jsonFile = "haxelib.json"; 22 | final json = (cast Json.parse(File.getContent(jsonFile)) : Haxelib); 23 | 24 | switch json.version.split('.') 25 | { 26 | case [ newMajor, newMinor, _ ]: 27 | if (newMajor < previousMajor || (newMajor == previousMajor && newMinor < previousMinor)) 28 | { 29 | throw new Exception('Version in haxelib.json is older than the last tag'); 30 | } 31 | 32 | if (newMajor > previousMajor || newMinor > previousMinor) 33 | { 34 | json.version = '$newMajor.$newMinor.0'; 35 | } 36 | else 37 | { 38 | json.version = '$newMajor.$newMinor.${ Std.parseInt(previousPatch) + 1 }'; 39 | } 40 | case _: 41 | throw new Exception('Invalid version in haxelib.json'); 42 | } 43 | 44 | File.saveContent(jsonFile, Json.stringify(json, '\t')); 45 | 46 | final define = "HXCPP_VERSION"; 47 | final lines = [ 48 | '#ifndef $define', 49 | '#define $define "${ json.version }"', 50 | '#endif' 51 | ]; 52 | 53 | File.saveContent("include/HxcppVersion.h", lines.join("\n")); 54 | 55 | Sys.println("hxcpp_release=" + json.version ); 56 | case _: 57 | throw new Exception('Invalid version in tag'); 58 | } 59 | case other: 60 | throw new Exception('Invalid version $other'); 61 | } 62 | } 63 | } 64 | --------------------------------------------------------------------------------