diff --git a/Runtime/Bindings/crypto_ffi.cpp b/Runtime/Bindings/crypto_ffi.cpp index 42839e83c..e7d217744 100644 --- a/Runtime/Bindings/crypto_ffi.cpp +++ b/Runtime/Bindings/crypto_ffi.cpp @@ -12,6 +12,7 @@ #include #include +#include size_t openssl_to_base64(unsigned char* dst, size_t dst_len, const unsigned char* src, size_t src_len) { EVP_ENCODE_CTX* ctx = EVP_ENCODE_CTX_new(); @@ -108,8 +109,9 @@ EMBED_BINARY(crypto_exported_types, "Runtime/Bindings/crypto_exports.h") namespace crypto_ffi { - const char* getTypeDefinitions() { - return crypto_exported_types; + std::string getTypeDefinitions() { + return std::string(crypto_exported_types, crypto_exported_types_size); + ; } void* getExportsTable() { diff --git a/Runtime/Bindings/crypto_ffi.hpp b/Runtime/Bindings/crypto_ffi.hpp index 6ecec3041..1dfda9a0f 100644 --- a/Runtime/Bindings/crypto_ffi.hpp +++ b/Runtime/Bindings/crypto_ffi.hpp @@ -2,12 +2,13 @@ #include #include +#include #include "crypto_exports.h" namespace crypto_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); const char* getVersionText(); long int getVersionNumber(); diff --git a/Runtime/Bindings/glfw_ffi.cpp b/Runtime/Bindings/glfw_ffi.cpp index 765573215..4121f0d1d 100644 --- a/Runtime/Bindings/glfw_ffi.cpp +++ b/Runtime/Bindings/glfw_ffi.cpp @@ -227,7 +227,7 @@ EMBED_BINARY(glfw_exported_types, "Runtime/Bindings/glfw_exports.h") namespace glfw_ffi { - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { size_t totalSize = glfw_aliased_types_size + glfw_exported_types_size + 1; std::string cdefs; @@ -237,7 +237,7 @@ namespace glfw_ffi { cdefs.append("\n"); cdefs.append(glfw_exported_types, glfw_exported_types_size); - return cdefs.c_str(); + return cdefs; } void* getExportsTable() { diff --git a/Runtime/Bindings/glfw_ffi.hpp b/Runtime/Bindings/glfw_ffi.hpp index 2e723fbe8..7f11a445d 100644 --- a/Runtime/Bindings/glfw_ffi.hpp +++ b/Runtime/Bindings/glfw_ffi.hpp @@ -8,6 +8,8 @@ #include "interop_ffi.hpp" #include "macros.hpp" +#include + #define GLFW_VERSION_STRING TOSTRING(GLFW_VERSION_MAJOR) "." TOSTRING(GLFW_VERSION_MINOR) "." TOSTRING(GLFW_VERSION_REVISION) void glfw_set_window_move_callback(GLFWwindow* window, std::queue* queue); @@ -29,6 +31,6 @@ void glfw_set_character_input_callback(GLFWwindow* window, std::queue -#include +#include #include @@ -51,8 +51,8 @@ EMBED_BINARY(iconv_exported_types, "Runtime/Bindings/iconv_exports.h") namespace iconv_ffi { - const char* getTypeDefinitions() { - return iconv_exported_types; + std::string getTypeDefinitions() { + return std::string(iconv_exported_types); } void* getExportsTable() { diff --git a/Runtime/Bindings/iconv_ffi.hpp b/Runtime/Bindings/iconv_ffi.hpp index 2e906642b..625eebcf1 100644 --- a/Runtime/Bindings/iconv_ffi.hpp +++ b/Runtime/Bindings/iconv_ffi.hpp @@ -2,10 +2,12 @@ #include #include +#include +#include #include "iconv_exports.h" namespace iconv_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } \ No newline at end of file diff --git a/Runtime/Bindings/interop_ffi.cpp b/Runtime/Bindings/interop_ffi.cpp index 6f883b419..096c65b65 100644 --- a/Runtime/Bindings/interop_ffi.cpp +++ b/Runtime/Bindings/interop_ffi.cpp @@ -47,7 +47,7 @@ EMBED_BINARY(interop_exported_types, "Runtime/Bindings/interop_exports.h") namespace interop_ffi { - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { size_t totalSize = interop_aliased_types_size + interop_exported_types_size + 1; std::string cdefs; @@ -57,7 +57,7 @@ namespace interop_ffi { cdefs.append("\n"); cdefs.append(interop_exported_types, interop_exported_types_size); - return cdefs.c_str(); + return cdefs; } void* getExportsTable() { diff --git a/Runtime/Bindings/interop_ffi.hpp b/Runtime/Bindings/interop_ffi.hpp index a70981239..d9f85bae5 100644 --- a/Runtime/Bindings/interop_ffi.hpp +++ b/Runtime/Bindings/interop_ffi.hpp @@ -4,6 +4,7 @@ #include #include +#include typedef WGPUTexture wgpu_texture_t; typedef WGPUBuffer wgpu_buffer_t; @@ -15,6 +16,6 @@ typedef std::queue* deferred_event_queue_t; #include "interop_exports.h" namespace interop_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } \ No newline at end of file diff --git a/Runtime/Bindings/labsound_ffi.cpp b/Runtime/Bindings/labsound_ffi.cpp index c6321f21e..d3ec82f59 100644 --- a/Runtime/Bindings/labsound_ffi.cpp +++ b/Runtime/Bindings/labsound_ffi.cpp @@ -7,6 +7,7 @@ #include #include +#include #include using namespace lab; @@ -397,7 +398,7 @@ EMBED_BINARY(labsound_exported_types, "Runtime/Bindings/labsound_exports.h") namespace labsound_ffi { - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { size_t totalSize = labsound_aliased_types_size + labsound_exported_types_size + 1; std::string cdefs; @@ -407,7 +408,7 @@ namespace labsound_ffi { cdefs.append("\n"); cdefs.append(labsound_exported_types, labsound_exported_types_size); - return cdefs.c_str(); + return cdefs; } void* getExportsTable() { diff --git a/Runtime/Bindings/labsound_ffi.hpp b/Runtime/Bindings/labsound_ffi.hpp index e9f1df26d..846797300 100644 --- a/Runtime/Bindings/labsound_ffi.hpp +++ b/Runtime/Bindings/labsound_ffi.hpp @@ -5,6 +5,7 @@ #include #include +#include // Opaque to LuaJIT typedef lab::AudioDevice_RtAudio* labsound_audio_device_t; @@ -32,7 +33,7 @@ static_assert(sizeof(labsound_audio_stream_config_t::desired_channels) == sizeof static_assert(sizeof(labsound_audio_stream_config_t::desired_samplerate) == sizeof(lab::AudioStreamConfig::desired_samplerate)); namespace labsound_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } diff --git a/Runtime/Bindings/rml_ffi.cpp b/Runtime/Bindings/rml_ffi.cpp index 805e5f679..deedf1cbc 100644 --- a/Runtime/Bindings/rml_ffi.cpp +++ b/Runtime/Bindings/rml_ffi.cpp @@ -191,7 +191,7 @@ namespace rml_ffi { return rml_ffi::assignedLuaState; } - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { size_t totalSize = rml_aliased_types_size + rml_exported_types_size + 1; std::string cdefs; @@ -201,7 +201,7 @@ namespace rml_ffi { cdefs.append("\n"); cdefs.append(rml_exported_types, rml_exported_types_size); - return cdefs.c_str(); + return cdefs; } void* getExportsTable() { diff --git a/Runtime/Bindings/rml_ffi.hpp b/Runtime/Bindings/rml_ffi.hpp index d16c7dbd4..c63a0c05c 100644 --- a/Runtime/Bindings/rml_ffi.hpp +++ b/Runtime/Bindings/rml_ffi.hpp @@ -6,6 +6,8 @@ #include +#include + typedef WGPUDevice wgpu_device_t; typedef rml_geometry_info_t* rml_compiled_geometry_t; typedef GLFWwindow* glfw_window_t; @@ -15,6 +17,6 @@ typedef GLFWwindow* glfw_window_t; namespace rml_ffi { void assignLuaState(lua_State* L); lua_State* getAssignedLuaState(); - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } diff --git a/Runtime/Bindings/runtime_ffi.cpp b/Runtime/Bindings/runtime_ffi.cpp index 6105e16e0..9718cb7d7 100644 --- a/Runtime/Bindings/runtime_ffi.cpp +++ b/Runtime/Bindings/runtime_ffi.cpp @@ -6,6 +6,8 @@ extern "C" { #include "luajit_repl.h" } +#include + EMBED_BINARY(runtime_exported_types, "Runtime/Bindings/runtime_exports.h") namespace runtime_ffi { @@ -22,7 +24,7 @@ namespace runtime_ffi { dotty(assignedLuaState); } - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { return runtime_exported_types; } diff --git a/Runtime/Bindings/runtime_ffi.hpp b/Runtime/Bindings/runtime_ffi.hpp index e64c38749..a3f2a137d 100644 --- a/Runtime/Bindings/runtime_ffi.hpp +++ b/Runtime/Bindings/runtime_ffi.hpp @@ -2,6 +2,8 @@ #include "lua.hpp" +#include + #include "runtime_exports.h" namespace runtime_ffi { @@ -13,6 +15,6 @@ namespace runtime_ffi { // REPL void runtime_repl_start(); - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } diff --git a/Runtime/Bindings/stbi_ffi.cpp b/Runtime/Bindings/stbi_ffi.cpp index fd134371f..df95add25 100644 --- a/Runtime/Bindings/stbi_ffi.cpp +++ b/Runtime/Bindings/stbi_ffi.cpp @@ -7,6 +7,7 @@ #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" +#include #include const char* stbi_version() { @@ -204,7 +205,7 @@ EMBED_BINARY(stbi_exported_types, "Runtime/Bindings/stbi_exports.h") namespace stbi_ffi { - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { return stbi_exported_types; } diff --git a/Runtime/Bindings/stbi_ffi.hpp b/Runtime/Bindings/stbi_ffi.hpp index 9510e9228..80c88d3dd 100644 --- a/Runtime/Bindings/stbi_ffi.hpp +++ b/Runtime/Bindings/stbi_ffi.hpp @@ -2,10 +2,11 @@ #include #include +#include #include "stbi_exports.h" namespace stbi_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } \ No newline at end of file diff --git a/Runtime/Bindings/stduuid_ffi.cpp b/Runtime/Bindings/stduuid_ffi.cpp index ab6d67c79..3b95bc489 100644 --- a/Runtime/Bindings/stduuid_ffi.cpp +++ b/Runtime/Bindings/stduuid_ffi.cpp @@ -2,6 +2,7 @@ #include #include +#include // The platform-specific RNG APIs aren't enabled by default since they're non-standard #define UUID_SYSTEM_GENERATOR @@ -85,7 +86,7 @@ EMBED_BINARY(stduuid_exported_types, "Runtime/Bindings/stduuid_exports.h") namespace stduuid_ffi { - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { return stduuid_exported_types; } diff --git a/Runtime/Bindings/stduuid_ffi.hpp b/Runtime/Bindings/stduuid_ffi.hpp index 9fc28ea6c..069b05254 100644 --- a/Runtime/Bindings/stduuid_ffi.hpp +++ b/Runtime/Bindings/stduuid_ffi.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include "stduuid_exports.h" bool uuid_create_v4(uuid_rfc_string_t* result); @@ -8,6 +10,6 @@ bool uuid_create_v5(const char* namespace_uuid_str, const char* name, uuid_rfc_s bool uuid_create_system(uuid_rfc_string_t* result); namespace stduuid_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } \ No newline at end of file diff --git a/Runtime/Bindings/uws_ffi.cpp b/Runtime/Bindings/uws_ffi.cpp index 5ba709042..5bb0fb073 100644 --- a/Runtime/Bindings/uws_ffi.cpp +++ b/Runtime/Bindings/uws_ffi.cpp @@ -4,6 +4,7 @@ #include "WebServer.hpp" +#include #include const char* uws_version() { @@ -197,7 +198,7 @@ EMBED_BINARY(uws_exported_types, "Runtime/Bindings/uws_exports.h") namespace uws_ffi { - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { size_t totalSize = uws_aliased_types_size + uws_exported_types_size + 1; std::string cdefs; @@ -207,7 +208,7 @@ namespace uws_ffi { cdefs.append("\n"); cdefs.append(uws_exported_types, uws_exported_types_size); - return cdefs.c_str(); + return cdefs; } void* getExportsTable() { diff --git a/Runtime/Bindings/uws_ffi.hpp b/Runtime/Bindings/uws_ffi.hpp index cb47ed170..c8629e425 100644 --- a/Runtime/Bindings/uws_ffi.hpp +++ b/Runtime/Bindings/uws_ffi.hpp @@ -6,7 +6,7 @@ #include namespace uws_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); uWS::Loop* assignEventLoop(void* existing_native_loop); void unassignEventLoop(uWS::Loop* uwsEventLoop); diff --git a/Runtime/Bindings/webgpu_ffi.cpp b/Runtime/Bindings/webgpu_ffi.cpp index 6ed4ceee8..5ac103f1b 100644 --- a/Runtime/Bindings/webgpu_ffi.cpp +++ b/Runtime/Bindings/webgpu_ffi.cpp @@ -12,7 +12,7 @@ EMBED_BINARY(webgpu_exported_types, "Runtime/Bindings/webgpu_exports.h") namespace webgpu_ffi { - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { size_t totalSize = webgpu_aliased_types_size + webgpu_exported_types_size + 1; std::string cdefs; @@ -22,7 +22,7 @@ namespace webgpu_ffi { cdefs.append("\n"); cdefs.append(webgpu_exported_types, webgpu_exported_types_size); - return cdefs.c_str(); + return cdefs; } void* getExportsTable() { diff --git a/Runtime/Bindings/webgpu_ffi.hpp b/Runtime/Bindings/webgpu_ffi.hpp index 7d66adbe1..6f57b7427 100644 --- a/Runtime/Bindings/webgpu_ffi.hpp +++ b/Runtime/Bindings/webgpu_ffi.hpp @@ -3,9 +3,11 @@ #include #include +#include + #include "webgpu_exports.h" namespace webgpu_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } \ No newline at end of file diff --git a/Runtime/Bindings/webview_ffi.cpp b/Runtime/Bindings/webview_ffi.cpp index f3d3f406e..2ac4761d6 100644 --- a/Runtime/Bindings/webview_ffi.cpp +++ b/Runtime/Bindings/webview_ffi.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include "macros.hpp" #include "webview_ffi.hpp" @@ -113,7 +113,7 @@ namespace webview_ffi { return static_cast(w)->setAppIcon(file_path); } - const char* getTypeDefinitions() { + std::string getTypeDefinitions() { size_t totalSize = webview_aliased_types_size + webview_exported_types_size + 1; std::string cdefs; @@ -123,7 +123,7 @@ namespace webview_ffi { cdefs.append("\n"); cdefs.append(webview_exported_types, webview_exported_types_size); - return cdefs.c_str(); + return cdefs; } void* getExportsTable() { diff --git a/Runtime/Bindings/webview_ffi.hpp b/Runtime/Bindings/webview_ffi.hpp index 2bc5ac412..25830fa45 100644 --- a/Runtime/Bindings/webview_ffi.hpp +++ b/Runtime/Bindings/webview_ffi.hpp @@ -1,9 +1,12 @@ #pragma once #include "webview.h" + +#include + #include "webview_exports.h" namespace webview_ffi { - const char* getTypeDefinitions(); + std::string getTypeDefinitions(); void* getExportsTable(); } \ No newline at end of file