Only include mongo/util/modules.h in extension public header if present

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, api.h includes mongo/util/modules.h in for modularity visibility macros. However, api.h will eventually be used by downstream teams, who'll have to explicitly remove the modules dependency because it's server-specific (they'll have to include that header even though their extensions are developed separately from the server).

      We should only include the header if it's available

      #if __has_include("mongo/util/modules.h") 
      #else #define MONGO_MOD_PUB // no-op if the header is unavailable
      

            Assignee:
            Finley Lau
            Reporter:
            Lynne Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: