Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-66203

Sweep: move MONGO_LOGV2_DEFAULT_COMPONENT definition below includes

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Service Arch 2022-05-16
    • 0

      SERVER-52604 links to a python script that will move all definitions of MONGO_LOGV2_DEFAULT_COMPONENT below the conventional block of includes a the top of .cpp files. After SERVER-52604, this is possible.

      Doing this makes it possible for headers to define (and then undef) the macro internally without worrying that another file has already defined it. This could be accomplished with nonstandard push_macro/pop_macro but that's complicated and nonstandard. We can do better.

      Doing this also makes a cleaner precompiled header / modules / caching model because headers will not be included multiple times with different values of MONGO_LOGV2_DEFAULT_COMPONENT. It mitigates one definition rule risk by the same logic.

      [split from SERVER-52604]

      I'm just running a script I already had from last year.
      There are some cases where a file needed manual intervention. Not many.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: