aboutsummaryrefslogtreecommitdiff
path: root/sokol_app.h
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2020-12-23 17:29:20 +0100
committerAndre Weissflog <floooh@gmail.com>2020-12-23 17:29:20 +0100
commit9571c8e9901c05a556d9e71d3735fc64c080349a (patch)
tree65d967ffe3c13116aa1e65ea5e9b7199f477e6c4 /sokol_app.h
parent36fdcc0257dd542065b4c246d620ca5493d65a4c (diff)
sokol_app.h: use 'raw' function pointer in sapp_html5_fetch_request
Diffstat (limited to 'sokol_app.h')
-rw-r--r--sokol_app.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sokol_app.h b/sokol_app.h
index 887d4865..da8d9a98 100644
--- a/sokol_app.h
+++ b/sokol_app.h
@@ -1140,11 +1140,9 @@ typedef struct sapp_html5_fetch_response {
void* user_data; /* user-provided user data pointer */
} sapp_html5_fetch_response;
-typedef void (*sapp_html5_fetch_callback) (const sapp_html5_fetch_response*);
-
typedef struct sapp_html5_fetch_request {
int dropped_file_index; /* 0..sapp_get_num_dropped_files()-1 */
- sapp_html5_fetch_callback callback; /* response callback function pointer (required) */
+ void (*callback)(const sapp_html5_fetch_response*); /* response callback function pointer (required) */
void* buffer_ptr; /* pointer to buffer to load data into */
uint32_t buffer_size; /* size in bytes of buffer */
void* user_data; /* optional userdata pointer */
@@ -3744,6 +3742,8 @@ _SOKOL_PRIVATE void _sapp_ios_show_keyboard(bool shown) {
extern "C" {
#endif
+typedef void (*_sapp_html5_fetch_callback) (const sapp_html5_fetch_response*);
+
/* this function is called from a JS event handler when the user hides
the onscreen keyboard pressing the 'dismiss keyboard key'
*/
@@ -3818,7 +3818,7 @@ EMSCRIPTEN_KEEPALIVE void _sapp_emsc_end_drop(int x, int y) {
}
}
-EMSCRIPTEN_KEEPALIVE void _sapp_emsc_invoke_fetch_cb(int index, int success, int error_code, sapp_html5_fetch_callback callback, uint32_t fetched_size, void* buf_ptr, uint32_t buf_size, void* user_data) {
+EMSCRIPTEN_KEEPALIVE void _sapp_emsc_invoke_fetch_cb(int index, int success, int error_code, _sapp_html5_fetch_callback callback, uint32_t fetched_size, void* buf_ptr, uint32_t buf_size, void* user_data) {
sapp_html5_fetch_response response;
memset(&response, 0, sizeof(response));
response.succeeded = (0 != success);
@@ -3948,7 +3948,7 @@ EM_JS(uint32_t, sapp_js_dropped_file_size, (int index), {
}
});
-EM_JS(void, sapp_js_fetch_dropped_file, (int index, sapp_html5_fetch_callback callback, void* buf_ptr, uint32_t buf_size, void* user_data), {
+EM_JS(void, sapp_js_fetch_dropped_file, (int index, _sapp_html5_fetch_callback callback, void* buf_ptr, uint32_t buf_size, void* user_data), {
var reader = new FileReader();
reader.onload = function(loadEvent) {
var content = loadEvent.target.result;