[HTML5] Fix JS build without eval.

Also fix download_buffer return type.
This commit is contained in:
Fabio Alessandrelli 2021-06-14 12:32:03 +02:00
parent 9b7b0a28b9
commit 049b5159f1
2 changed files with 7 additions and 4 deletions

View File

@ -41,7 +41,7 @@
// JavaScript functions defined in library_godot_editor_tools.js // JavaScript functions defined in library_godot_editor_tools.js
extern "C" { extern "C" {
extern int godot_js_os_download_buffer(const uint8_t *p_buf, int p_buf_size, const char *p_name, const char *p_mime); extern void godot_js_os_download_buffer(const uint8_t *p_buf, int p_buf_size, const char *p_name, const char *p_mime);
} }
static void _javascript_editor_init_callback() { static void _javascript_editor_init_callback() {

View File

@ -28,11 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/ /*************************************************************************/
#ifdef JAVASCRIPT_EVAL_ENABLED
#include "api/javascript_singleton.h" #include "api/javascript_singleton.h"
#include "emscripten.h" #include "emscripten.h"
extern "C" {
extern void godot_js_os_download_buffer(const uint8_t *p_buf, int p_buf_size, const char *p_name, const char *p_mime);
}
#ifdef JAVASCRIPT_EVAL_ENABLED
extern "C" { extern "C" {
typedef union { typedef union {
int64_t i; int64_t i;
@ -301,7 +305,6 @@ union js_eval_ret {
}; };
extern int godot_js_eval(const char *p_js, int p_use_global_ctx, union js_eval_ret *p_union_ptr, void *p_byte_arr, void *p_byte_arr_write, void *(*p_callback)(void *p_ptr, void *p_ptr2, int p_len)); extern int godot_js_eval(const char *p_js, int p_use_global_ctx, union js_eval_ret *p_union_ptr, void *p_byte_arr, void *p_byte_arr_write, void *(*p_callback)(void *p_ptr, void *p_ptr2, int p_len));
extern int godot_js_os_download_buffer(const uint8_t *p_buf, int p_buf_size, const char *p_name, const char *p_mime);
} }
void *resize_PackedByteArray_and_open_write(void *p_arr, void *r_write, int p_len) { void *resize_PackedByteArray_and_open_write(void *p_arr, void *r_write, int p_len) {