FileReader/Writer: Refactor to remove <Windows.h> include

This commit is contained in:
Luke Street 2022-02-22 00:46:49 -05:00
parent e13b498266
commit f27a63f312
4 changed files with 12 additions and 17 deletions

View File

@ -1,14 +1,6 @@
#pragma once
#if _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#else
#include <cstdio>
#endif
#include <memory>
#include <string>
@ -49,7 +41,7 @@ public:
void setCacheSize(const atInt32 blockSize);
#if _WIN32
using HandleType = HANDLE;
using HandleType = void*;
#else
using HandleType = FILE*;
#endif

View File

@ -1,13 +1,6 @@
#pragma once
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#else
#include <cstdio>
#endif
#include "athena/IStreamWriter.hpp"
#include "athena/Types.hpp"
@ -43,7 +36,7 @@ public:
void writeUBytes(const atUint8* data, atUint64 len) override;
#ifdef _WIN32
using HandleType = HANDLE;
using HandleType = void*;
#else
using HandleType = FILE*;
#endif

View File

@ -1,4 +1,10 @@
#include "athena/FileReader.hpp"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include "win32_largefilewrapper.h"
namespace athena::io {

View File

@ -1,5 +1,9 @@
#include "athena/FileWriter.hpp"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <algorithm>
#include <limits>