In mongodb/mongo-c-driver#477, jesse suggested using the bson_strcasecmp() compatibility function instead of strcasecmp(), as the latter is not available on Windows. It turns out that the latter is actually defined for Windows via mongoc-util-private.h:
/* string comparison functions for Windows */ #ifdef _WIN32 #define strcasecmp _stricmp #define strncasecmp _strnicmp #endif
We should standardize on one of these two approaches, especially since libbson and libmongoc are now in the same repository. IMO, the mongoc-util-private.h approach is preferable to adding a custom function that delegates. Even if that function is inlined by the compiler, there is cognitive overhead with having to use bson_strcasecmp() for case-insensitive but strcmp() for case-sensitive comparisons.