In order to prevent build mistakes, the C++ driver should ensure that _MD is defined, since we are compiling the shared library with /MD. This ensures that the same C RTL (and thus the same heap) is used across all translation units between the mongo library and the client code:
We're already doing this in version.cpp, but of course this code isn't hit by consumers of the C++ driver. It needs to be in a header.
Also, confusingly, we are using /MDd for debug mode; I think this ought to be /MTd, since we're not building a DLL. This could cause weirdness if driver developers didn't also use /MDd.