missing winnt.h include in platform/pause.h

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I went to use this macro and couldn't figure out how to get it to work. It doesn't include any headers, so the compiler reports that the reference to YieldProcessor is invalid.

      https://github.com/10gen/mongo/blob/b4a8ce1d8149c4a1ca3cf5efc02ca60c2b40e8b7/src/mongo/platform/pause.h#L84

      // On Windows, use the winnt.h YieldProcessor macro
      #define MONGO_YIELD_CORE_FOR_SMT() YieldProcessor()
      

      I've tried a few things.
      Adding a #include <winnt.h> above it.

      This yields a #error complaint that there's "no target architecture".

      https://parsley.mongodb.com/evergreen/mongodb_mongo_master_windows_compile_required_compile_dist_test_patch_eba65446f5d9279b65041e15ce7dd8c1138f5537_64cb1715d6d80a4b794e31aa_23_08_03_02_56_14/0/task?bookmarks=9965

      It looks like this could be due to missing windows.h? So I #include <windows.h> above <winnt.h> and then lots of code fails to compile due to usage of min() and max(), etc.

      Someone with more Windows experience could figure this out.

            Assignee:
            Unassigned
            Reporter:
            Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: