From: mistachkin Date: Thu, 28 Jul 2016 04:14:37 +0000 (+0000) Subject: Work in progress on setting a calling convention for all callback functions. X-Git-Tag: version-3.14.0~30^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69def7ff2f872b3c7579d93843ba504e61dc2b2f;p=thirdparty%2Fsqlite.git Work in progress on setting a calling convention for all callback functions. FossilOrigin-Name: 02b8040e1add02734d2dbc6c59737ab74ff8fb18 --- diff --git a/Makefile.msc b/Makefile.msc index cd866ce4a4..7220f71cd4 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -464,20 +464,24 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS) # !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0 !IF "$(PLATFORM)"=="x86" -CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall -SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall !ELSE !IFNDEF PLATFORM -CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall -SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall !ELSE CORE_CCONV_OPTS = SHELL_CCONV_OPTS = +TEST_CCONV_OPTS = !ENDIF !ENDIF !ELSE CORE_CCONV_OPTS = SHELL_CCONV_OPTS = +TEST_CCONV_OPTS = !ENDIF # These are additional compiler options used for the core library. @@ -1960,6 +1964,7 @@ TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN) TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024 +TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS) TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C) diff --git a/autoconf/Makefile.msc b/autoconf/Makefile.msc index 7f62bcb129..2f7447383f 100644 --- a/autoconf/Makefile.msc +++ b/autoconf/Makefile.msc @@ -449,12 +449,12 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS) # !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0 !IF "$(PLATFORM)"=="x86" -CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall -SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall !ELSE !IFNDEF PLATFORM -CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall -SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall !ELSE CORE_CCONV_OPTS = SHELL_CCONV_OPTS = diff --git a/ext/misc/percentile.c b/ext/misc/percentile.c index 74a4c9d12b..a5d7e84913 100644 --- a/ext/misc/percentile.c +++ b/ext/misc/percentile.c @@ -167,7 +167,7 @@ static void percentStep(sqlite3_context *pCtx, int argc, sqlite3_value **argv){ /* ** Compare to doubles for sorting using qsort() */ -static int doubleCmp(const void *pA, const void *pB){ +static int SQLITE_CDECL doubleCmp(const void *pA, const void *pB){ double a = *(double*)pA; double b = *(double*)pB; if( a==b ) return 0; diff --git a/ext/misc/spellfix.c b/ext/misc/spellfix.c index cbcf8b7c5d..1ac1712f4e 100644 --- a/ext/misc/spellfix.c +++ b/ext/misc/spellfix.c @@ -2231,7 +2231,7 @@ static int spellfix1Score(int iDistance, int iRank){ ** Compare two spellfix1_row objects for sorting purposes in qsort() such ** that they sort in order of increasing distance. */ -static int spellfix1RowCompare(const void *A, const void *B){ +static int SQLITE_CDECL spellfix1RowCompare(const void *A, const void *B){ const struct spellfix1_row *a = (const struct spellfix1_row*)A; const struct spellfix1_row *b = (const struct spellfix1_row*)B; return a->iScore - b->iScore; diff --git a/manifest b/manifest index d0e7b14e54..a174c165d9 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -C Enhance\sthe\squery\splanner\scost\sestimation\sfor\sindex\sscans\sto\stake\sinto\saccount\nWHERE\sclause\sterms\sthat\scan\sbe\scomputed\susing\sonly\sthe\sindex\sand\sthat\sdo\snot\nrequire\slooking\sup\srows\sin\sthe\soriginal\stable.\s\sThis\sfixes\san\sobscure\nperformance\sregression\sthat\sarose\swhen\sthe\sORDER\sBY\sLIMIT\soptimization\swas\nadded\sby\scheck-in\s[bf46179d44843]. -D 2016-07-27T19:30:53.586 +C Work\sin\sprogress\son\ssetting\sa\scalling\sconvention\sfor\sall\scallback\sfunctions. +D 2016-07-28T04:14:37.455 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 -F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a +F Makefile.msc 843c563182b26a358674c520d7b8d40b832e9436 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION cb29eb11e493dd85b3eeec4053c03949bf98478e F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -11,7 +11,7 @@ F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am 1a47d071e3d5435f8f7ebff7eb6703848bbd65d4 -F autoconf/Makefile.msc 0eca137c12542bd76c253a2d24380f29ade59b95 +F autoconf/Makefile.msc 05a99e98a8895461574ccb9604444d9e97c1f0b6 F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7 F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1 F autoconf/configure.ac cacf2616abf6e4a569bde2ef365c143caeec40bc @@ -214,13 +214,13 @@ F ext/misc/fuzzer.c 7c64b8197bb77b7d64eff7cac7848870235d4c25 F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c F ext/misc/json1.c d51a764ba43a49e191bc3536238bfab3def258ca F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342 -F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63 +F ext/misc/percentile.c 92699c8cd7d517ff610e6037e56506f8904dae2e F ext/misc/regexp.c a68d25c659bd2d893cd1215667bbf75ecb9dc7d4 F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a F ext/misc/scrub.c 1c5bfb8b0cd18b602fcb55755e84abf0023ac2fb F ext/misc/series.c e11e534ada797d5b816d7e7a93c022306563ca35 F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52 -F ext/misc/spellfix.c bf1b922c2750698e9a3d4c50cce6974adb7e93be +F ext/misc/spellfix.c a4723b6aff748a417b5091b68a46443265c40f0d F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512 F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95 F ext/misc/vfsstat.c 6110aeeaab2f1df17a923c8a8acef3c74f6dc515 @@ -385,15 +385,15 @@ F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/select.c f3c6e9065fb34f6a23af27ec7f1f717ffbfc2ee4 F src/shell.c 9351fc6de11e1d908648c0a92d85627138e3dee5 -F src/sqlite.h.in c6e68a4a47610631822a4f8f83a44c9f75339331 +F src/sqlite.h.in a0760a3f7b1939e395a3e74d245e5bb03cd54fb1 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 46f300b6e300e0fa916d7d58c44b53415b8471a9 F src/sqliteInt.h d25c18c1272a7811e2569c39bfc2fca96156eead F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247 F src/status.c 5b18f9526900f61189ab0b83f1ef41d9f871a2ab F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9 -F src/tclsqlite.c 5c213bf5fee084390f632df2328cf0821d483799 -F src/test1.c 186e3b53c402b7a73bcb4ade2b77709675c39fe3 +F src/tclsqlite.c 53274d5bbd66e7246c573a6b48026781d42c7efe +F src/test1.c 5ec959d088af063cac44cf1685455f3fcddecc8c F src/test2.c 5586f43fcd9a1be0830793cf9d354082c261b25b F src/test3.c c75c8af0eadb335236c9e61b51044c58a8f7dd59 F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e @@ -1448,9 +1448,9 @@ F tool/mkopcodeh.tcl a01d2c1d8a6205b03fc635adf3735b4c523befd3 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkpragmatab.tcl f0d5bb266d1d388cf86fce5ba01a891e95d72d41 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 -F tool/mksqlite3c-noext.tcl 87240b09c20042999b41d5fabe091b7111287835 -F tool/mksqlite3c.tcl 63af8429841f08552e6da1d93b3dee4a93ff8071 -F tool/mksqlite3h.tcl e7b106fc4f29fbc258e8ba9b88d9108332ea2ade +F tool/mksqlite3c-noext.tcl aa58ea3be311c81821c2cd3209f55e46b07ab656 +F tool/mksqlite3c.tcl a52ead27e2ac5d4b616e945a0601f628f4328329 +F tool/mksqlite3h.tcl fab97967314e63384a3ed23fd35f0d8188352400 F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b F tool/mkvsix.tcl 4abcaf3267171b2faadaf9b82a0dfbaa6e98f8b7 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 @@ -1508,8 +1508,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4d59df02d3713b3e3804e1a88e676749b2794286 50f8ea37fb9647c4a9da2c269a4d6f54b10ce96b -R a589b595bdfe9868de18def836f199ce -T +closed 50f8ea37fb9647c4a9da2c269a4d6f54b10ce96b -U drh -Z 994e8dc5cbb7e25d0e8cc4a952504fbd +P 9e2b26811452a5011d0a97a689636fa4409da856 +R 6c56defa4f9211ce028bec2ac1e13231 +T *branch * callbackConv +T *sym-callbackConv * +T -sym-trunk * +U mistachkin +Z d50c4a0ba4b8e38dec3c91619f068656 diff --git a/manifest.uuid b/manifest.uuid index 9b63447ecc..57781e18c1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9e2b26811452a5011d0a97a689636fa4409da856 \ No newline at end of file +02b8040e1add02734d2dbc6c59737ab74ff8fb18 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index e8f5d24845..009f080a86 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -54,9 +54,19 @@ extern "C" { #ifndef SQLITE_CDECL # define SQLITE_CDECL #endif +#ifndef SQLITE_APICALL +# define SQLITE_APICALL +#endif #ifndef SQLITE_STDCALL -# define SQLITE_STDCALL +# define SQLITE_STDCALL SQLITE_APICALL +#endif +#ifndef SQLITE_CALLBACK +# define SQLITE_CALLBACK #endif +#ifndef SQLITE_SYSAPI +# define SQLITE_SYSAPI +#endif + /* ** These no-op macros are used in front of interfaces to mark those @@ -318,7 +328,7 @@ int sqlite3_close_v2(sqlite3*); ** This is legacy and deprecated. It is included for historical ** compatibility and is not documented. */ -typedef int (*sqlite3_callback)(void*,int,char**, char**); +typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**); /* ** CAPI3REF: One-Step Query Execution Interface @@ -385,7 +395,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**); int sqlite3_exec( sqlite3*, /* An open database */ const char *sql, /* SQL to be evaluated */ - int (*callback)(void*,int,char**,char**), /* Callback function */ + int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback func */ void *, /* 1st argument to callback */ char **errmsg /* Error msg written here */ ); @@ -733,26 +743,30 @@ struct sqlite3_file { typedef struct sqlite3_io_methods sqlite3_io_methods; struct sqlite3_io_methods { int iVersion; - int (*xClose)(sqlite3_file*); - int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); - int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); - int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); - int (*xSync)(sqlite3_file*, int flags); - int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); - int (*xLock)(sqlite3_file*, int); - int (*xUnlock)(sqlite3_file*, int); - int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); - int (*xFileControl)(sqlite3_file*, int op, void *pArg); - int (*xSectorSize)(sqlite3_file*); - int (*xDeviceCharacteristics)(sqlite3_file*); + int (SQLITE_CALLBACK *xClose)(sqlite3_file*); + int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, + sqlite3_int64 iOfst); + int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, + sqlite3_int64 iOfst); + int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size); + int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags); + int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); + int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int); + int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int); + int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut); + int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg); + int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*); + int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*); /* Methods above are valid for version 1 */ - int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); - int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); - void (*xShmBarrier)(sqlite3_file*); - int (*xShmUnmap)(sqlite3_file*, int deleteFlag); + int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, + void volatile**); + int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags); + void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*); + int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag); /* Methods above are valid for version 2 */ - int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); - int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); + int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, + void **pp); + int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); /* Methods above are valid for version 3 */ /* Additional methods may be added in future releases */ }; @@ -1194,7 +1208,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** any of these methods if the iVersion of the VFS is less than 3. */ typedef struct sqlite3_vfs sqlite3_vfs; -typedef void (*sqlite3_syscall_ptr)(void); +typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void); struct sqlite3_vfs { int iVersion; /* Structure version number (currently 3) */ int szOsFile; /* Size of subclassed sqlite3_file */ @@ -1202,31 +1216,37 @@ struct sqlite3_vfs { sqlite3_vfs *pNext; /* Next registered VFS */ const char *zName; /* Name of this virtual file system */ void *pAppData; /* Pointer to application-specific data */ - int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, + int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, int flags, int *pOutFlags); - int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); - int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); - int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); - void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); - void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); - void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); - void (*xDlClose)(sqlite3_vfs*, void*); - int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); - int (*xSleep)(sqlite3_vfs*, int microseconds); - int (*xCurrentTime)(sqlite3_vfs*, double*); - int (*xGetLastError)(sqlite3_vfs*, int, char *); + int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir); + int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, + int *pResOut); + int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, + int nOut, char *zOut); + void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename); + void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); + void (*(SQLITE_CALLBACK *xDlSym)(sqlite3_vfs*,void*, + const char *zSymbol))(void); + void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*); + int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut); + int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds); + int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*); + int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *); /* ** The methods above are in version 1 of the sqlite_vfs object ** definition. Those that follow are added in version 2 or later */ - int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); + int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); /* ** The methods above are in versions 1 and 2 of the sqlite_vfs object. ** Those below are for version 3 and greater. */ - int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); - sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); - const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); + int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, + sqlite3_syscall_ptr); + sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, + const char *zName); + const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, + const char *zName); /* ** The methods above are in versions 1 through 3 of the sqlite_vfs object. ** New fields may be appended in future versions. The iVersion @@ -1493,13 +1513,13 @@ int sqlite3_db_config(sqlite3*, int op, ...); */ typedef struct sqlite3_mem_methods sqlite3_mem_methods; struct sqlite3_mem_methods { - void *(*xMalloc)(int); /* Memory allocation function */ - void (*xFree)(void*); /* Free a prior allocation */ - void *(*xRealloc)(void*,int); /* Resize an allocation */ - int (*xSize)(void*); /* Return the size of an allocation */ - int (*xRoundup)(int); /* Round up request size to allocation size */ - int (*xInit)(void*); /* Initialize the memory allocator */ - void (*xShutdown)(void*); /* Deinitialize the memory allocator */ + void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */ + void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */ + void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */ + int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */ + int (SQLITE_CALLBACK *xRoundup)(int); /* Round up size to allocation size */ + int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */ + void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize memory allocator */ void *pAppData; /* Argument to xInit() and xShutdown() */ }; @@ -2233,7 +2253,7 @@ int sqlite3_complete16(const void *sql); ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ -int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); +int sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*); /* ** CAPI3REF: Set A Busy Timeout @@ -2677,7 +2697,8 @@ void sqlite3_randomness(int N, void *P); */ int sqlite3_set_authorizer( sqlite3*, - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), + int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*, + const char*), void *pUserData ); @@ -2784,9 +2805,9 @@ int sqlite3_set_authorizer( ** subject to change in future versions of SQLite. */ SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*, - void(*xTrace)(void*,const char*), void*); + void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*); SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, - void(*xProfile)(void*,const char*,sqlite3_uint64), void*); + void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*); /* ** CAPI3REF: SQL Trace Event Codes @@ -2877,7 +2898,7 @@ SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, int sqlite3_trace_v2( sqlite3*, unsigned uMask, - int(*xCallback)(unsigned,void*,void*,void*), + int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*), void *pCtx ); @@ -2913,7 +2934,7 @@ int sqlite3_trace_v2( ** database connections for the meaning of "modify" in this paragraph. ** */ -void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); +void sqlite3_progress_handler(sqlite3*,int,int(SQLITE_CALLBACK *)(void*),void*); /* ** CAPI3REF: Opening A New Database Connection @@ -3744,17 +3765,20 @@ typedef struct sqlite3_context sqlite3_context; ** See also: [sqlite3_bind_parameter_count()], ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. */ -int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); +int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, + void(SQLITE_CALLBACK *)(void*)); int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, - void(*)(void*)); + void(SQLITE_CALLBACK *)(void*)); int sqlite3_bind_double(sqlite3_stmt*, int, double); int sqlite3_bind_int(sqlite3_stmt*, int, int); int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); int sqlite3_bind_null(sqlite3_stmt*, int); -int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); -int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); +int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int, + void(SQLITE_CALLBACK *)(void*)); +int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, + void(SQLITE_CALLBACK *)(void*)); int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, - void(*)(void*), unsigned char encoding); + void(SQLITE_CALLBACK *)(void*), unsigned char encoding); int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); @@ -4422,9 +4446,9 @@ int sqlite3_create_function( int nArg, int eTextRep, void *pApp, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*) + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) ); int sqlite3_create_function16( sqlite3 *db, @@ -4432,9 +4456,9 @@ int sqlite3_create_function16( int nArg, int eTextRep, void *pApp, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*) + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) ); int sqlite3_create_function_v2( sqlite3 *db, @@ -4442,10 +4466,10 @@ int sqlite3_create_function_v2( int nArg, int eTextRep, void *pApp, - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), - void (*xStep)(sqlite3_context*,int,sqlite3_value**), - void (*xFinal)(sqlite3_context*), - void(*xDestroy)(void*) + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*), + void (SQLITE_CALLBACK *xDestroy)(void*) ); /* @@ -4487,8 +4511,9 @@ SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); SQLITE_DEPRECATED int sqlite3_global_recover(void); SQLITE_DEPRECATED void sqlite3_thread_cleanup(void); -SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), - void*,sqlite3_int64); +SQLITE_DEPRECATED int sqlite3_memory_alarm( + void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int), + void*,sqlite3_int64); #endif /* @@ -4707,7 +4732,8 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** the SQL function is running. */ void *sqlite3_get_auxdata(sqlite3_context*, int N); -void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); +void sqlite3_set_auxdata(sqlite3_context*, int N, void*, + void (SQLITE_CALLBACK *)(void*)); /* @@ -4724,7 +4750,7 @@ void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); ** The typedef is necessary to work around problems in certain ** C++ compilers. */ -typedef void (*sqlite3_destructor_type)(void*); +typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*); #define SQLITE_STATIC ((sqlite3_destructor_type)0) #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) @@ -4843,9 +4869,10 @@ typedef void (*sqlite3_destructor_type)(void*); ** than the one containing the application-defined function that received ** the [sqlite3_context] pointer, the results are undefined. */ -void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); +void sqlite3_result_blob(sqlite3_context*, const void*, int, + void(SQLITE_CALLBACK *)(void*)); void sqlite3_result_blob64(sqlite3_context*,const void*, - sqlite3_uint64,void(*)(void*)); + sqlite3_uint64,void(SQLITE_CALLBACK *)(void*)); void sqlite3_result_double(sqlite3_context*, double); void sqlite3_result_error(sqlite3_context*, const char*, int); void sqlite3_result_error16(sqlite3_context*, const void*, int); @@ -4855,12 +4882,17 @@ void sqlite3_result_error_code(sqlite3_context*, int); void sqlite3_result_int(sqlite3_context*, int); void sqlite3_result_int64(sqlite3_context*, sqlite3_int64); void sqlite3_result_null(sqlite3_context*); -void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); +void sqlite3_result_text(sqlite3_context*, const char*, int, + void(SQLITE_CALLBACK *)(void*)); void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, - void(*)(void*), unsigned char encoding); -void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); -void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); -void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); + void(SQLITE_CALLBACK *)(void*), + unsigned char encoding); +void sqlite3_result_text16(sqlite3_context*, const void*, int, + void(SQLITE_CALLBACK *)(void*)); +void sqlite3_result_text16le(sqlite3_context*, const void*, int, + void(SQLITE_CALLBACK *)(void*)); +void sqlite3_result_text16be(sqlite3_context*, const void*, int, + void(SQLITE_CALLBACK *)(void*)); void sqlite3_result_value(sqlite3_context*, sqlite3_value*); void sqlite3_result_zeroblob(sqlite3_context*, int n); int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); @@ -4965,22 +4997,22 @@ int sqlite3_create_collation( const char *zName, int eTextRep, void *pArg, - int(*xCompare)(void*,int,const void*,int,const void*) + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) ); int sqlite3_create_collation_v2( sqlite3*, const char *zName, int eTextRep, void *pArg, - int(*xCompare)(void*,int,const void*,int,const void*), - void(*xDestroy)(void*) + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*), + void(SQLITE_CALLBACK *xDestroy)(void*) ); int sqlite3_create_collation16( sqlite3*, const void *zName, int eTextRep, void *pArg, - int(*xCompare)(void*,int,const void*,int,const void*) + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) ); /* @@ -5013,12 +5045,12 @@ int sqlite3_create_collation16( int sqlite3_collation_needed( sqlite3*, void*, - void(*)(void*,sqlite3*,int eTextRep,const char*) + void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*) ); int sqlite3_collation_needed16( sqlite3*, void*, - void(*)(void*,sqlite3*,int eTextRep,const void*) + void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*) ); #ifdef SQLITE_HAS_CODEC @@ -5317,8 +5349,8 @@ sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); ** ** See also the [sqlite3_update_hook()] interface. */ -void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); -void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); +void *sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*); +void *sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*); /* ** CAPI3REF: Data Change Notification Callbacks @@ -5371,7 +5403,7 @@ void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); */ void *sqlite3_update_hook( sqlite3*, - void(*)(void *,int ,char const *,char const *,sqlite3_int64), + void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64), void* ); @@ -5698,7 +5730,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff); ** See also: [sqlite3_reset_auto_extension()] ** and [sqlite3_cancel_auto_extension()] */ -int sqlite3_auto_extension(void (*xEntryPoint)(void)); +int sqlite3_auto_extension(void (SQLITE_CALLBACK *xEntryPoint)(void)); /* ** CAPI3REF: Cancel Automatic Extension Loading @@ -5710,7 +5742,7 @@ int sqlite3_auto_extension(void (*xEntryPoint)(void)); ** unregistered and it returns 0 if X was not on the list of initialization ** routines. */ -int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void)); +int sqlite3_cancel_auto_extension(void (SQLITE_CALLBACK *xEntryPoint)(void)); /* ** CAPI3REF: Reset Automatic Extension Loading @@ -5755,37 +5787,41 @@ typedef struct sqlite3_module sqlite3_module; */ struct sqlite3_module { int iVersion; - int (*xCreate)(sqlite3*, void *pAux, + int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVTab, char**); - int (*xConnect)(sqlite3*, void *pAux, + int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVTab, char**); - int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); - int (*xDisconnect)(sqlite3_vtab *pVTab); - int (*xDestroy)(sqlite3_vtab *pVTab); - int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); - int (*xClose)(sqlite3_vtab_cursor*); - int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, - int argc, sqlite3_value **argv); - int (*xNext)(sqlite3_vtab_cursor*); - int (*xEof)(sqlite3_vtab_cursor*); - int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); - int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); - int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); - int (*xBegin)(sqlite3_vtab *pVTab); - int (*xSync)(sqlite3_vtab *pVTab); - int (*xCommit)(sqlite3_vtab *pVTab); - int (*xRollback)(sqlite3_vtab *pVTab); - int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, - void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), - void **ppArg); - int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); + int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); + int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab); + int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab); + int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, + sqlite3_vtab_cursor **ppCursor); + int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*); + int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, + int idxNum, const char *idxStr, + int argc, sqlite3_value **argv); + int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*); + int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*); + int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); + int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); + int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, + sqlite3_int64 *); + int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab); + int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab); + int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab); + int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab); + int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, + int nArg, const char *zName, + void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**), + void **ppArg); + int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew); /* The methods above are in version 1 of the sqlite_module object. Those ** below are for version 2 and greater. */ - int (*xSavepoint)(sqlite3_vtab *pVTab, int); - int (*xRelease)(sqlite3_vtab *pVTab, int); - int (*xRollbackTo)(sqlite3_vtab *pVTab, int); + int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int); + int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int); + int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int); }; /* @@ -5974,7 +6010,7 @@ int sqlite3_create_module_v2( const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ void *pClientData, /* Client data for xCreate/xConnect */ - void(*xDestroy)(void*) /* Module destructor function */ + void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */ ); /* @@ -6515,15 +6551,15 @@ void sqlite3_mutex_leave(sqlite3_mutex*); */ typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; struct sqlite3_mutex_methods { - int (*xMutexInit)(void); - int (*xMutexEnd)(void); - sqlite3_mutex *(*xMutexAlloc)(int); - void (*xMutexFree)(sqlite3_mutex *); - void (*xMutexEnter)(sqlite3_mutex *); - int (*xMutexTry)(sqlite3_mutex *); - void (*xMutexLeave)(sqlite3_mutex *); - int (*xMutexHeld)(sqlite3_mutex *); - int (*xMutexNotheld)(sqlite3_mutex *); + int (SQLITE_CALLBACK *xMutexInit)(void); + int (SQLITE_CALLBACK *xMutexEnd)(void); + sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int); + void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *); + void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *); + int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *); + void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *); + int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *); + int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *); }; /* @@ -7219,18 +7255,21 @@ typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; struct sqlite3_pcache_methods2 { int iVersion; void *pArg; - int (*xInit)(void*); - void (*xShutdown)(void*); - sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); - void (*xCachesize)(sqlite3_pcache*, int nCachesize); - int (*xPagecount)(sqlite3_pcache*); - sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); - void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); - void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, - unsigned oldKey, unsigned newKey); - void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); - void (*xDestroy)(sqlite3_pcache*); - void (*xShrink)(sqlite3_pcache*); + int (SQLITE_CALLBACK *xInit)(void*); + void (SQLITE_CALLBACK *xShutdown)(void*); + sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, + int bPurgeable); + void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); + int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); + sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, + int createFlag); + void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, + int discard); + void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, + unsigned oldKey, unsigned newKey); + void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); + void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*); }; /* @@ -7241,16 +7280,18 @@ struct sqlite3_pcache_methods2 { typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; struct sqlite3_pcache_methods { void *pArg; - int (*xInit)(void*); - void (*xShutdown)(void*); - sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); - void (*xCachesize)(sqlite3_pcache*, int nCachesize); - int (*xPagecount)(sqlite3_pcache*); - void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); - void (*xUnpin)(sqlite3_pcache*, void*, int discard); - void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); - void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); - void (*xDestroy)(sqlite3_pcache*); + int (SQLITE_CALLBACK *xInit)(void*); + void (SQLITE_CALLBACK *xShutdown)(void*); + sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable); + void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); + int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); + void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, + int createFlag); + void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard); + void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, + unsigned newKey); + void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); }; @@ -7580,7 +7621,7 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); */ int sqlite3_unlock_notify( sqlite3 *pBlocked, /* Waiting connection */ - void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ + void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback func */ void *pNotifyArg /* Argument to pass to xNotify */ ); @@ -7695,7 +7736,7 @@ void sqlite3_log(int iErrCode, const char *zFormat, ...); */ void *sqlite3_wal_hook( sqlite3*, - int(*)(void *,sqlite3*,const char*,int), + int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int), void* ); @@ -8168,7 +8209,7 @@ int sqlite3_db_cacheflush(sqlite3*); */ SQLITE_EXPERIMENTAL void *sqlite3_preupdate_hook( sqlite3 *db, - void(*xPreUpdate)( + void(SQLITE_CALLBACK *xPreUpdate)( void *pCtx, /* Copy of third arg to preupdate_hook() */ sqlite3 *db, /* Database handle */ int op, /* SQLITE_UPDATE, DELETE or INSERT */ diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 2de88f41f4..e559043c08 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -4167,7 +4167,7 @@ static void init_all(Tcl_Interp *interp){ #endif #define TCLSH_MAIN main /* Needed to fake out mktclapp */ -int TCLSH_MAIN(int argc, char **argv){ +int SQLITE_CDECL TCLSH_MAIN(int argc, char **argv){ Tcl_Interp *interp; #if !defined(_WIN32_WCE) diff --git a/src/test1.c b/src/test1.c index 7d83881139..35c43d0ef9 100644 --- a/src/test1.c +++ b/src/test1.c @@ -6444,7 +6444,7 @@ struct win32FileLocker { /* ** The background thread that does file locking. */ -static void win32_file_locker(void *pAppData){ +static void SQLITE_CDECL win32_file_locker(void *pAppData){ struct win32FileLocker *p = (struct win32FileLocker*)pAppData; if( p->evName ){ HANDLE ev = OpenEvent(EVENT_MODIFY_STATE, FALSE, p->evName); diff --git a/tool/mksqlite3c-noext.tcl b/tool/mksqlite3c-noext.tcl index 601b8cce8c..fad6c9e584 100644 --- a/tool/mksqlite3c-noext.tcl +++ b/tool/mksqlite3c-noext.tcl @@ -220,7 +220,7 @@ proc copy_file {filename} { if {[lsearch -exact $cdecllist $funcname] >= 0} { append line SQLITE_CDECL } else { - append line SQLITE_STDCALL + append line SQLITE_APICALL } append line " " $funcname $rest puts $out $line diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl index 7e8558d2ab..b7561cfa5b 100644 --- a/tool/mksqlite3c.tcl +++ b/tool/mksqlite3c.tcl @@ -232,7 +232,7 @@ proc copy_file {filename} { if {[lsearch -exact $cdecllist $funcname] >= 0} { append line SQLITE_CDECL } else { - append line SQLITE_STDCALL + append line SQLITE_APICALL } append line " " $funcname $rest puts $out $line diff --git a/tool/mksqlite3h.tcl b/tool/mksqlite3h.tcl index 1af6d75730..d0ddba9cfa 100644 --- a/tool/mksqlite3h.tcl +++ b/tool/mksqlite3h.tcl @@ -120,7 +120,7 @@ foreach file $filelist { if {[lsearch -exact $cdecllist $funcname] >= 0} { append line SQLITE_CDECL } else { - append line SQLITE_STDCALL + append line SQLITE_APICALL } append line " " $funcname $rest }