Skip to content

Commit

Permalink
build: fileio - build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Feb 5, 2023
1 parent 512f8c4 commit 670146e
Show file tree
Hide file tree
Showing 3 changed files with 464 additions and 563 deletions.
15 changes: 0 additions & 15 deletions src/fileio/extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@

#include "../sqlite3ext.h"

#if defined(FILEIO_WIN32_DLL) && (defined(_WIN32) || defined(WIN32))
#/* To allow a standalone DLL, use this next replacement function: */
#undef sqlite3_win32_utf8_to_unicode
#define sqlite3_win32_utf8_to_unicode utf8_to_utf16
#
LPWSTR utf8_to_utf16(const char* z) {
int nAllot = MultiByteToWideChar(CP_UTF8, 0, z, -1, NULL, 0);
LPWSTR rv = sqlite3_malloc(nAllot * sizeof(WCHAR));
if (rv != 0 && 0 < MultiByteToWideChar(CP_UTF8, 0, z, -1, rv, nAllot))
return rv;
sqlite3_free(rv);
return 0;
}
#endif

int fileioscalar_init(sqlite3* db);
int lsdir_init(sqlite3* db);
int scanfile_init(sqlite3* db);
Expand Down
Loading

0 comments on commit 670146e

Please sign in to comment.