Skip to content

Commit 8c44ab4

Browse files
committed
Exported a new cloudsync_register to be used in the xcframework
1 parent 24ca313 commit 8c44ab4

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

src/cloudsync.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3169,12 +3169,7 @@ void cloudsync_commit_alter (sqlite3_context *context, int argc, sqlite3_value *
31693169

31703170
// MARK: - Main Entrypoint -
31713171

3172-
APIEXPORT int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) {
3173-
DEBUG_FUNCTION("sqlite3_cloudsync_init");
3174-
3175-
#ifndef SQLITE_CORE
3176-
SQLITE_EXTENSION_INIT2(pApi);
3177-
#endif
3172+
int cloudsync_register (sqlite3 *db, char **pzErrMsg) {
31783173
int rc = SQLITE_OK;
31793174

31803175
// there's no built-in way to verify if sqlite3_cloudsync_init has already been called
@@ -3307,3 +3302,13 @@ APIEXPORT int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite
33073302
return SQLITE_OK;
33083303
}
33093304

3305+
APIEXPORT int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) {
3306+
DEBUG_FUNCTION("sqlite3_cloudsync_init");
3307+
3308+
#ifndef SQLITE_CORE
3309+
SQLITE_EXTENSION_INIT2(pApi);
3310+
#endif
3311+
3312+
return cloudsync_register(db, pzErrMsg);
3313+
}
3314+

src/cloudsync.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,17 @@
1616
#include "sqlite3.h"
1717
#endif
1818

19-
#define CLOUDSYNC_VERSION "0.8.22"
19+
#ifdef __cplusplus
20+
extern "C" {
21+
#endif
22+
23+
#define CLOUDSYNC_VERSION "0.8.23"
2024

2125
int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);
26+
int cloudsync_register (sqlite3 *db, char **pzErrMsg);
27+
28+
#ifdef __cplusplus
29+
}
30+
#endif
2231

2332
#endif

0 commit comments

Comments
 (0)