Fix include of windows.h in mmap.h (#10885)

Summary:
If windows.h is not included in a particular way, it can conflict with other code including it. I don't know all the details, but having just one standard place where we include windows.h in header files seems best and seems to fix the internal issue we hit.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10885

Test Plan: CI and internal validation

Reviewed By: anand1976

Differential Revision: D40738945

Pulled By: pdillinger

fbshipit-source-id: 88f635e895b1c7b810baad159e6dbb8351344cac
main
Peter Dillinger 2 years ago committed by Facebook GitHub Bot
parent 17553bdd5e
commit 5d3953114f
  1. 4
      port/mmap.h

@ -6,8 +6,8 @@
#pragma once #pragma once
#ifdef OS_WIN #ifdef OS_WIN
#include <windows.h> #include "port/win/port_win.h"
// ^^^ Must come first // ^^^ For proper/safe inclusion of windows.h. Must come first.
#include <memoryapi.h> #include <memoryapi.h>
#else #else
#include <sys/mman.h> #include <sys/mman.h>

Loading…
Cancel
Save