Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-427

MONGOC_I_AM_A_DRIVER not sufficient for including some internal headers

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.0
    • Affects Version/s: 1.0.0
    • Component/s: None
    • None
    • Fully Compatible

      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.

            Assignee:
            tyler@10gen.com Tyler Brock
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: