As I learned from this forum discussion with some of Swift's developers, Swift 5.0 caps alignment at 16 bytes, and any C types with a larger alignment that may have previously been fully imported will be imported as OpaquePointers instead. This affects libbson types such as bson_t and bson_iter_t.
Initially, I thought a simple workaround could be using typealiases to conditionally define what pointer type to use based on Swift version, as described in
However, May Hoque pointed out that OpaquePointers cannot be dereferenced, and that being able to deference various libbson types is crucial to the driver.
Therefore, we will need a more robust workaround. Matt Broadstone suggests finding a way to specify the libbson/libmongoc interfaces ourselves, based on the Swift 4 interfaces XCode generates, that would be used instead of the ones the Swift compiler generates.
We should figure out how to do this, and ideally complete this work in the near future before people start switching their applications over to Swift 5.