Disable winsqlite3 on 32 bit targets #1151
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
winsqlite3.dll
actually has a totally custom ABI on 32-bit targets which is different than SQLite typically uses on those platforms (and on any other -- literally this is the only time that SQLite uses an ABI other thanextern "C"
, as far as I can tell -- it even would have required modification to SQLite itself (and its header) to do so).This is what it the bindgen output looks for winsqlite3: https://gist.github.com/thomcc/4bbbecd0bd79e5ed181fcc9960c59e77. Note that this applies both to the exported functions, and to callbacks, which makes it very hard for us to support. (On 64 bit targets, the ABI is the same as everywhere else --
extern "C"
).In practice, the feature currently doesn't actually work at all on these targets, since we try to pass
extern "C" fn
as callbacks to functions that expectextern "stdcall"
, which gives a strange compile error. This makes that explicit, by emitting a compile error on these targets, rather than a mysterious error.Eventually it could be possible to support this, but I think it might require some new Rust features, such as allowing a macro after
extern
(as inextern abi!() { ... }
andextern abi!() fn
, so that we could swapextern "stdcall"
andextern "C"
)... but this would still be pretty unfortunate, as we'd have a feature that would break code when enabled, which is generally bad form. We could emit wrappers (for non-varargs funcs), but that's a big maintenance burden.It's very tempting to me to say that we should remove this feature, as it has been the cause of several headaches now, and people should almost certainly just use bundled instead... But I guess it's not really that bad to keep just for 64 bit targets.