diff --git a/src/cregistry/sqlext.c b/src/cregistry/sqlext.c
index 4c24ea62a..39c359aaf 100644
a
|
b
|
|
4 | 4 | |
5 | 5 | #include "vercomp.h" |
6 | 6 | |
| 7 | #include <stdio.h> |
7 | 8 | #include <string.h> |
8 | 9 | #include <sqlite3ext.h> |
9 | 10 | SQLITE_EXTENSION_INIT1 |
… |
… |
SQLITE_EXTENSION_INIT1 |
19 | 20 | int sqlite3_extension_init( |
20 | 21 | sqlite3 *db, /* The database connection */ |
21 | 22 | char **pzErrMsg UNUSED, /* Write error messages here */ |
22 | | #if HAVE_SQLITE3EXT_H |
| 23 | #ifdef sqlite3_create_collation |
23 | 24 | const sqlite3_api_routines *pApi /* API methods */ |
24 | 25 | #else |
| 26 | #warning "macports.sqlext won't work" |
25 | 27 | const void *pApi |
26 | 28 | #endif |
27 | 29 | ) { |
28 | | #if HAVE_SQLITE3EXT_H |
| 30 | int rc = SQLITE_OK; |
| 31 | #ifdef sqlite3_create_collation |
29 | 32 | SQLITE_EXTENSION_INIT2(pApi) |
30 | 33 | |
31 | | sqlite3_create_collation(db, "VERSION", SQLITE_UTF8, NULL, sql_version); |
| 34 | fprintf(stderr, "creating collation sequence VERSION to sql_version() for database \"%s\"\n", |
| 35 | sqlite3_db_filename(db, 0)); |
| 36 | rc = sqlite3_create_collation(db, "VERSION", SQLITE_UTF8, NULL, sql_version); |
| 37 | if (rc != SQLITE_OK) { |
| 38 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db)); |
| 39 | } |
32 | 40 | #endif |
33 | | return 0; |
| 41 | return rc; |
34 | 42 | } |