Skip to content

Commit 9a55728

Browse files
committed
Fix CURL inclusion logic for WASM builds
1 parent 307c096 commit 9a55728

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/network.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ int network_extract_query_param(const char *query, const char *key, char *output
400400
return -3; // Key not found
401401
}
402402

403-
#ifndef CLOUDSYNC_OMIT_CURL
403+
#if !defined(CLOUDSYNC_OMIT_CURL) || defined(SQLITE_WASM_EXTRA_INIT)
404404
bool network_compute_endpoints (sqlite3_context *context, network_data *data, const char *conn_string) {
405405
// compute endpoints
406406
bool result = false;
@@ -567,7 +567,7 @@ network_data *cloudsync_network_data(sqlite3_context *context) {
567567
void cloudsync_network_init (sqlite3_context *context, int argc, sqlite3_value **argv) {
568568
DEBUG_FUNCTION("cloudsync_network_init");
569569

570-
#if !defined(CLOUDSYNC_OMIT_CURL) && !defined(SQLITE_WASM_EXTRA_INIT)
570+
#ifndef CLOUDSYNC_OMIT_CURL
571571
curl_global_init(CURL_GLOBAL_ALL);
572572
#endif
573573

@@ -632,7 +632,7 @@ void cloudsync_network_cleanup (sqlite3_context *context, int argc, sqlite3_valu
632632

633633
sqlite3_result_int(context, SQLITE_OK);
634634

635-
#if !defined(CLOUDSYNC_OMIT_CURL) && !defined(SQLITE_WASM_EXTRA_INIT)
635+
#ifndef CLOUDSYNC_OMIT_CURL
636636
curl_global_cleanup();
637637
#endif
638638
}

src/wasm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#ifdef SQLITE_WASM_EXTRA_INIT
2+
#define CLOUDSYNC_OMIT_CURL
23

34
#include <stdio.h>
45
#include <stdlib.h>

0 commit comments

Comments
 (0)