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

Refactor header include checks and test in Evergreen

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • 1.14.0, 1.15.0
    • None
    • libbson, libmongoc
    • None

    Description

      The header checks described in CDRIVER-2797 are repeated throughout the codebase.

      We should consider refactoring them into three files

      mongoc-header-check.h, consisting of:

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

      bson-header-check.h, consisting of:

      #if !defined(BSON_INSIDE) && !defined(BSON_COMPILATION)
      #error "Only <bson/bson.h> can be included directly."
      #endif
      

      And common-header-check.h, consisting of:

      #if !defined(MONGOC_INSIDE) && !defined(MONGOC_COMPILATION) && \
      !defined(BSON_INSIDE)	 !defined(BSON_COMPILATION)
      #error "Only <mongoc/mongoc.h> or <bson/bson.h> can be included directly."
      #endif
      

      We can verify with an Evergreen task that each header (except bson.h and mongoc.h) includes one of these checks directly after the license. We could also use the same check to verify that each file has a license.

      Attachments

        Activity

          People

            kevin.albertson@mongodb.com Kevin Albertson
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: