[CDRIVER-427] MONGOC_I_AM_A_DRIVER not sufficient for including some internal headers Created: 18/Sep/14  Updated: 19/Oct/16  Resolved: 30/Oct/14

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.0.0
Fix Version/s: 1.1.0

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Tyler Brock
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-65 Implement WriteBatch::count() Closed
Backwards Compatibility: Fully Compatible

 Description   

While working on the PHP driver prototype, I was unable to include mongoc-bulk-operation-private.h despite MONGOC_I_AM_A_DRIVER being defined. This was due to mongoc-bulk-operation-private.h including another private header, which had different requirements.

mongoc-bulk-operation-private.h has:

#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
#error "Only <mongoc.h> can be included directly."
#endif

It depends on mongoc-client.h, which has:

#if !defined (MONGOC_INSIDE) && !defined (MONGOC_COMPILATION)
# error "Only <mongoc.h> can be included directly."
#endif

I don't believe MONGOC_INSIDE and MONGOC_COMPILATION are intended to be set by our driver, so I expect the other private files may need to define MONGOC_INSIDE internally.



 Comments   
Comment by Githook User [ 30/Oct/14 ]

Author:

{u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}

Message: CDRIVER-427 move header include guard above checks
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b5b3de81402a2f99501746a9212a9118cb98f5f0

Comment by Tyler Brock [ 30/Oct/14 ]

https://github.com/mongodb/mongo-c-driver/pull/108

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