Revise #include to make each .hpp individually compilable

Mind that min/max Windows.h mess is Microsoft's problem, not ours.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2023-10-18 09:12:06 +02:00
parent 11e56f927f
commit 856be3a0d8
9 changed files with 17 additions and 28 deletions

View File

@ -8,6 +8,7 @@
#include <assert.h>
#include <stddef.h>
#ifdef _WIN32
#include <windows.h>
#include <sal.h>
#endif
#include <type_traits>

View File

@ -6,7 +6,7 @@
#pragma once
#include "compat.hpp"
#include <exception>
#include <stdexcept>
namespace stdex
{

View File

@ -6,7 +6,11 @@
#pragma once
#include "compat.hpp"
#include "system.hpp"
#ifdef _WIN32
#include <windows.h>
#include <intrin.h>
#include <intsafe.h>
#endif
#include <stdexcept>
namespace stdex
@ -63,7 +67,6 @@ namespace stdex
throw std::invalid_argument("add overflow");
}
///
/// Bitwise rotates left
///

View File

@ -5,6 +5,7 @@
#pragma once
#include "compat.hpp"
#include <memory>
namespace stdex

View File

@ -10,7 +10,6 @@
#include "memory.hpp"
#include "sgml.hpp"
#include "string.hpp"
#include "system.hpp"
#include <stdarg.h>
#include <stdint.h>
#include <math.h>

View File

@ -11,11 +11,11 @@
#include "math.hpp"
#include "ring.hpp"
#include "string.hpp"
#include "system.hpp"
#include "unicode.hpp"
#include <stdint.h>
#include <stdlib.h>
#if defined(_WIN32)
#include <windows.h>
#include <asptlb.h>
#include <objidl.h>
#include <WinSock2.h>

View File

@ -13,13 +13,14 @@
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#ifdef __APPLE__
#include <xlocale.h>
#endif
#ifdef _WIN32
#include <rpcdce.h>
#else
#if defined(_WIN32)
#include <windows.h>
#include <rpc.h>
#elif defined(__APPLE__)
#include <uuid/uuid.h>
#include <xlocale.h>
#else
#include <xlocale.h>
#endif
#include <algorithm>
#include <locale>

View File

@ -5,13 +5,9 @@
#pragma once
#include "compat.hpp"
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX // Collides with std::min/max
#endif
#include <windows.h>
#include <intrin.h>
#include <intsafe.h>
#include <oaidl.h>
#include <tchar.h>
#else
@ -22,21 +18,10 @@
#include <sys/types.h>
#include <unistd.h>
#endif
#include "compat.hpp"
#include <regex>
#include <stdexcept>
#include <string>
// In case somebody #included <windows.h> before us and didn't #define NOMINMAX
#ifdef _WIN32
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#endif
#if defined(_WIN32)
#define PATH_SEPARATOR '\\'
#define PATH_SEPARATOR_STR "\\"

View File

@ -8,7 +8,6 @@
#include "compat.hpp"
#include "endian.hpp"
#include "math.hpp"
#include "system.hpp"
#include <stdint.h>
#ifndef _WIN32
#include <iconv.h>