[CDRIVER-3533] Ensure files referencing ssize_t include sys/types.h Created: 11/Feb/20  Updated: 02/Jun/23

Status: Backlog
Project: C Driver
Component/s: libbson, libmongoc
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to MONGOCRYPT-247 Conditionally define ssize_t if it is... Closed
Quarter: FY24Q3

 Description   

To define ssize_t on POSIX systems, sys/types.h should be included and Windows requires typedefs in bson-compat.h. Ensure that files in libmongoc that are referencing ssize_t are including both. Currently it appears that files in libmongoc get sys/types.h through bson.h => bson-types.h

There are plenty of libmongoc source files that utilize ssize_t without directly including this <sys/types.h>. This appears to work because they all end up including
bson.h, which in turn includes bson-types.h, which happens to include <sys/types.h>. But if a libmongoc source file was introduced that happened to use ssize_t and not depend on bson.h, it may lead to the a compilation error.


Generated at Wed Feb 07 21:18:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.