]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Accomplish fileio standalone for Win32 with less intervention.
authorlarrybr <larrybr@noemail.net>
Mon, 20 Sep 2021 21:42:39 +0000 (21:42 +0000)
committerlarrybr <larrybr@noemail.net>
Mon, 20 Sep 2021 21:42:39 +0000 (21:42 +0000)
FossilOrigin-Name: af5dcc9c2a3a45d10b985f6b7ea18d39c75502ed10fa6496aad787dbe8c8c3fb

ext/misc/fileio.c
manifest
manifest.uuid

index deb714cee8465f1154a5bc5d0f941158c8fd22cf..c9988f60782dd808a3ac04d42974eb1bd45fe2cb 100644 (file)
@@ -238,10 +238,10 @@ static sqlite3_uint64 fileTimeToUnixTime(
 #
 LPWSTR utf8_to_utf16(const char *z){
   int nAllot = MultiByteToWideChar(CP_UTF8, 0, z, -1, NULL, 0);
-  LPWSTR rv = malloc(nAllot * sizeof(WCHAR));
+  LPWSTR rv = sqlite3_malloc(nAllot * sizeof(WCHAR));
   if( rv!=0 && 0 < MultiByteToWideChar(CP_UTF8, 0, z, -1, rv, nAllot) )
     return rv;
-  free(rv);
+  sqlite3_free(rv);
   return 0;
 }
 #endif
@@ -1021,15 +1021,9 @@ int sqlite3_fileio_init(
 }
 
 #if defined(FILEIO_WIN32_DLL) && (defined(_WIN32) || defined(WIN32))
-   /* To allow a standalone DLL, make test_windirent.c take these next
-    * 3 functions from C runtime instead of from SQLite library: */
-#  undef sqlite3_malloc
-#  define sqlite3_malloc malloc
-#  undef sqlite3_free
-#  define sqlite3_free free
-#  undef sqlite3_stricmp
-#  define sqlite3_stricmp stricmp
-   /* Just pull in this .c so above redefines take said effect. As a
-    * side-effect, this extension becomes a single translation unit. */
+/* To allow a standalone DLL, make test_windirent.c use the same
+ * redefined SQLite API calls as the above extension code does.
+ * Just pull in this .c to accomplish this. As a beneficial side
+ * effect, this extension becomes a single translation unit. */
 #  include "test_windirent.c"
 #endif
index 33f095e45c030662271d036cc7135bb084130dff..6cdb72f9741436e86ba09d8b9db28048dd62f5cf 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Allow\sfileio\sextension\sto\sbe\sa\sstand-alone\sDLL\sfor\sWin32
-D 2021-09-20T20:15:28.135
+C Accomplish\sfileio\sstandalone\sfor\sWin32\swith\sless\sintervention.
+D 2021-09-20T21:42:39.389
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -301,7 +301,7 @@ F ext/misc/dbdump.c b8592f6f2da292c62991a13864a60d6c573c47a9cc58362131b9e6a64f82
 F ext/misc/decimal.c 09f967dcf4a1ee35a76309829308ec278d3648168733f4a1147820e11ebefd12
 F ext/misc/eval.c 04bc9aada78c888394204b4ed996ab834b99726fb59603b0ee3ed6e049755dc1
 F ext/misc/explain.c 0086fab288d4352ea638cf40ac382aad3b0dc5e845a1ea829a694c015fd970fe
-F ext/misc/fileio.c 896dcad10a0c584647995b4aa2be7f5802b02fb237171f6a394ea89f264d7053
+F ext/misc/fileio.c 57fefd0efc535e62bb8b07fa146875171481da81a759bbfbe2fc91bab90058e0
 F ext/misc/fossildelta.c 1240b2d3e52eab1d50c160c7fe1902a9bd210e052dc209200a750bbf885402d5
 F ext/misc/fuzzer.c eae560134f66333e9e1ca4c8ffea75df42056e2ce8456734565dbe1c2a92bf3d
 F ext/misc/ieee754.c cd6ab89f85fda8a020559b3f4d03001a8a62dd856beda5af3f558621d12be913
@@ -1925,7 +1925,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 99d6bb22e8735681443bfe67287aa15ce2c57d0d63e304abf8aa01fde50dd021
-R afb4d54eb24c4692fcc97528588cab39
+P d1cc3105b2baceb9f426fd6bc8d8317de3af09a0f02517715bd292c68e282fa1
+R b25569838c321c8a1dce73819376c2fc
 U larrybr
-Z 5b9c18b20b82047bc497d18ca81df306
+Z 29bd4bd5979c45d391558f5226ed2e5b
index 9a59a58df50e4dbef6b376ba89fdafc1e29d6eb0..6ec998e46519298f346790e4ba72e3a0bb81795b 100644 (file)
@@ -1 +1 @@
-d1cc3105b2baceb9f426fd6bc8d8317de3af09a0f02517715bd292c68e282fa1
\ No newline at end of file
+af5dcc9c2a3a45d10b985f6b7ea18d39c75502ed10fa6496aad787dbe8c8c3fb
\ No newline at end of file