From: stephan Date: Thu, 12 Sep 2024 21:33:44 +0000 (+0000) Subject: A slight tweak to consio to enable it to build both (A) directly embedded in shell... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=293b960f8a8d0ab3c6422db80e222037f05b27bd;p=thirdparty%2Fsqlite.git A slight tweak to consio to enable it to build both (A) directly embedded in shell.c and (B) as a separately-compiled .c file for use with sqlite3-rsync.c. FossilOrigin-Name: 6ffb392f922ba848329f24f474ac56aa6afbf12836af9f738c539399a97264c4 --- diff --git a/Makefile.in b/Makefile.in index ca0afe4838..b5b0c744bc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -703,20 +703,23 @@ dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h RSYNC_SRC = \ $(TOP)/tool/sqlite3-rsync.c \ $(TOP)/ext/misc/sha1.c \ + $(TOP)/ext/consio/console_io.c \ sqlite3.c RSYNC_OPT = \ -DSQLITE_ENABLE_DBPAGE_VTAB \ + -USQLITE_THREADSAFE \ -DSQLITE_THREADSAFE=0 \ -DSQLITE_OMIT_LOAD_EXTENSION \ - -DSQLITE_OMIT_DEPRECATED + -DSQLITE_OMIT_DEPRECATED \ + -DCONSIO_SET_ERROR_STREAM RSYNC_DEP = \ $(TOP)/ext/consio/console_io.h \ $(TOP)/ext/consio/console_io.c sqlite3-rsync$(TEXE): $(RSYNC_DEP) $(RSYNC_SRC) - $(TCC) -o $@ $(RSYNC_SRC) $(TLIBS) + $(TCC) -o $@ $(RSYNC_OPT) $(RSYNC_SRC) $(TLIBS) scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \ diff --git a/ext/consio/console_io.c b/ext/consio/console_io.c index 75324a34fd..6b79d2d490 100755 --- a/ext/consio/console_io.c +++ b/ext/consio/console_io.c @@ -154,7 +154,7 @@ static ConsoleInfo consoleInfo = { SAC_NoConsole /* sacSetup */ }; -SQLITE_INTERNAL_LINKAGE FILE* invalidFileStream = (FILE *)~0; +FILE* invalidFileStream = (FILE *)~0; # if CIO_WIN_WC_XLATE static void maybeSetupAsConsole(PerStreamTags *ppst, short odir){ diff --git a/ext/consio/console_io.h b/ext/consio/console_io.h index 1affa15bad..7950be8a5a 100644 --- a/ext/consio/console_io.h +++ b/ext/consio/console_io.h @@ -120,7 +120,7 @@ SQLITE_INTERNAL_LINKAGE void SQLITE_CDECL consoleRestore( void ); ** It is error to close a stream so designated, then, without ** designating another, use the corresponding {o,e}Emit(...). */ -SQLITE_INTERNAL_LINKAGE FILE *invalidFileStream; +extern FILE *invalidFileStream; SQLITE_INTERNAL_LINKAGE FILE *setOutputStream(FILE *pf); # ifdef CONSIO_SET_ERROR_STREAM SQLITE_INTERNAL_LINKAGE FILE *setErrorStream(FILE *pf); diff --git a/manifest b/manifest index 4abc07e65f..ff133c03a6 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Convert\ssqlite3-rsync.c\sto\suse\sthe\sext/consio\sI/O\slibrary.\sThe\scaveat\sis\sthat\sit\srequires\sdirect\sinclusion\sof\sthe\sconsio\ssource\scode,\smaking\ssqlite3-rsync.c\sno\slonger\sa\sstandalone\sfile. -D 2024-09-12T20:50:16.673 +C A\sslight\stweak\sto\sconsio\sto\senable\sit\sto\sbuild\sboth\s(A)\sdirectly\sembedded\sin\sshell.c\sand\s(B)\sas\sa\sseparately-compiled\s.c\sfile\sfor\suse\swith\ssqlite3-rsync.c. +D 2024-09-12T21:33:44.373 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in dd8e98b6437b73a8a3bdbb1cc3812d8965e46759d0c6b0d84cfdc848f0b860cb +F Makefile.in b81b311f1bd172ed879024f93aefa0bb4e0b9e62ff9b4947dafa28076a67490d F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc f25c476f22a25f23af8dc7260e9f95896250e7fceb621388ca8ae4f096bd3fda F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159 @@ -53,8 +53,8 @@ F ext/README.md fd5f78013b0a2bc6f0067afb19e6ad040e89a10179b4f6f03eee58fac5f169bd F ext/async/README.txt e12275968f6fde133a80e04387d0e839b0c51f91 F ext/async/sqlite3async.c 6f247666b495c477628dd19364d279c78ea48cd90c72d9f9b98ad1aff3294f94 F ext/async/sqlite3async.h 46b47c79357b97ad85d20d2795942c0020dc20c532114a49808287f04aa5309a -F ext/consio/console_io.c d2b74afae8d301de2e8447b1045fcd33eb59df13bf581d906d99c74fe5d2b13f x -F ext/consio/console_io.h b5ebe34aa15b357621ebbea3d3f2e2b24750d4280b5802516409e23947fd9ee5 +F ext/consio/console_io.c 5f8d6b832faa9db9f7442d6e02cf7e62409282c31fe68efa67da312db88c4fab x +F ext/consio/console_io.h 6212909529c4ab3deeeee29db2d0b2b9cd5c881cc9dd51dede079273ce91db3d F ext/expert/README.md b321c2762bb93c18ea102d5a5f7753a4b8bac646cb392b3b437f633caf2020c3 F ext/expert/expert.c d548d603a4cc9e61f446cc179c120c6713511c413f82a4a32b1e1e69d3f086a4 F ext/expert/expert1.test 661f873fd451127edf822ef0d520088faa319135f6a15bd10be6801ac284ac9b @@ -2174,7 +2174,7 @@ F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60 F tool/sqldiff.c 847fc8fcfddf5ce4797b7394cad6372f2f5dc17d8186e2ef8fb44d50fae4f44a -F tool/sqlite3-rsync.c a0521dbb5dd335834a101f9e562a35c4fbd3a844bc3ba989d3463fa81abcf84d +F tool/sqlite3-rsync.c b87369e3fe58d2e1b12e16ecc5d0d290de990a23aae685efd09444cdca76aa88 F tool/sqlite3_analyzer.c.in 8da2b08f56eeac331a715036cf707cc20f879f231362be0c22efd682e2b89b4f F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898 F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848 @@ -2213,11 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 53fb9b11807ff7accd8cd41f9cb6516d2503f161ea976940437a1d3aae868665 -R 4bb3e75cba104380172bbda59929fb5d -T *branch * sqlite3-rsync-consio -T *sym-sqlite3-rsync-consio * -T -sym-sqlite3-rsync * Cancelled\sby\sbranch. +P 62a9b6fd55ad08d7d9ae90b2741a814199ad0d84025608b284cac2e8f8e36f62 +R bcfc13e3c777cfcd2240b16c73bdc871 U stephan -Z 9e59548ff1a12e5f4219e9ef4eda27f0 +Z 20ed6fbedd1d3c6f2e6aa6b2bcc2581e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ca87bd1f84..2627a0c5dc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -62a9b6fd55ad08d7d9ae90b2741a814199ad0d84025608b284cac2e8f8e36f62 +6ffb392f922ba848329f24f474ac56aa6afbf12836af9f738c539399a97264c4 diff --git a/tool/sqlite3-rsync.c b/tool/sqlite3-rsync.c index 5cd66f1579..d1d53cac19 100644 --- a/tool/sqlite3-rsync.c +++ b/tool/sqlite3-rsync.c @@ -82,6 +82,7 @@ struct SQLiteRsync { #define REPLICA_READY 0x65 /* Read to receive page content */ #define REPLICA_MSG 0x66 /* Informational message */ +#include "ext/consio/console_io.h" /* From here onward, fgets() is redirected to the console_io library. */ # define fgets(b,n,f) fGetsUtf8(b,n,f) /* @@ -108,6 +109,7 @@ struct SQLiteRsync { # define eputz(z) ePutsUtf8(z) # define eputf ePrintfUtf8 # define oputb(buf,na) oPutbUtf8(buf,na) +# define fflush(s) fFlushBuffer(s) /**************************************************************************** ** Beginning of the popen2() implementation copied from Fossil ************* @@ -128,11 +130,6 @@ static void win32_fatal_error(const char *zMsg){ #include #endif -#define SQLITE_INTERNAL_LINKAGE static -#define CONSIO_SET_ERROR_STREAM -#include "ext/consio/console_io.c" -#define fflush(s) fFlushBuffer(s) /* must be defined AFTER console_io.c */ - /* ** The following macros are used to cast pointers to integers and ** integers to pointers. The way you do this varies from one compiler