mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Include windows.h before other Win32 header files
This commit is contained in:
@@ -35,15 +35,14 @@
|
|||||||
|
|
||||||
// Neither MSVC nor MinGW provide `mmap`
|
// Neither MSVC nor MinGW provide `mmap`
|
||||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
// clang-format off
|
// clang-format off: maintain `include` order
|
||||||
// (we need these `include`s in this order)
|
#define WIN32_LEAN_AND_MEAN // Include less from `windows.h`
|
||||||
#define WIN32_LEAN_AND_MEAN // include less from windows.h
|
|
||||||
#include <windows.h> // target architecture
|
#include <windows.h> // target architecture
|
||||||
#include <fileapi.h> // CreateFileA
|
|
||||||
#include <winbase.h> // CreateFileMappingA
|
|
||||||
#include <memoryapi.h> // MapViewOfFile
|
|
||||||
#include <handleapi.h> // CloseHandle
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
#include <fileapi.h> // CreateFileA
|
||||||
|
#include <handleapi.h> // CloseHandle
|
||||||
|
#include <memoryapi.h> // MapViewOfFile
|
||||||
|
#include <winbase.h> // CreateFileMappingA
|
||||||
|
|
||||||
static char *mapFile(int fd, std::string const &path, size_t) {
|
static char *mapFile(int fd, std::string const &path, size_t) {
|
||||||
void *mappingAddr = nullptr;
|
void *mappingAddr = nullptr;
|
||||||
|
|||||||
@@ -27,10 +27,13 @@
|
|||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#define WIN32_LEAN_AND_MEAN // Include less from `windows.h` to avoid conflicts
|
// clang-format off: maintain `include` order
|
||||||
|
#define WIN32_LEAN_AND_MEAN // Include less from `windows.h`
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
// clang-format on
|
||||||
#include <errhandlingapi.h>
|
#include <errhandlingapi.h>
|
||||||
#include <processthreadsapi.h>
|
#include <processthreadsapi.h>
|
||||||
|
|
||||||
#undef max // This macro conflicts with `std::numeric_limits<...>::max()`
|
#undef max // This macro conflicts with `std::numeric_limits<...>::max()`
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user