diff --git a/include/common.hpp b/include/common.hpp index ca3fbfad..62e0cb52 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -156,6 +156,48 @@ using namespace std::chrono_literals; REPERTORY_IGNORE_WARNINGS_DISABLE() +#ifdef _WIN32 +#ifdef CreateDirectory +#undef CreateDirectory +#endif + +#ifdef CreateFile +#undef CreateFile +#endif + +#ifdef DeleteFile +#undef DeleteFile +#endif + +#ifdef RemoveDirectory +#undef RemoveDirectory +#endif + +#ifndef _SH_DENYRW +#define _SH_DENYRW 0x10 // deny read/write mode +#endif + +#ifndef _SH_DENYWR +#define _SH_DENYWR 0x20 // deny write mode +#endif + +#ifndef _SH_DENYRD +#define _SH_DENYRD 0x30 // deny read mode +#endif + +#ifndef _SH_DENYNO +#define _SH_DENYNO 0x40 // deny none mode +#endif + +#ifndef _SH_SECURE +#define _SH_SECURE 0x80 // secure mode +#endif +#endif + +#ifndef ENETDOWN +#define ENETDOWN 100 +#endif + namespace repertory { auto get_repertory_git_revision() -> const std::string &; auto get_repertory_version() -> const std::string &; diff --git a/include/platform/platform.hpp b/include/platform/platform.hpp index 77b291fa..9986b725 100644 --- a/include/platform/platform.hpp +++ b/include/platform/platform.hpp @@ -22,55 +22,10 @@ #ifndef INCLUDE_PLATFORM_PLATFORM_HPP_ #define INCLUDE_PLATFORM_PLATFORM_HPP_ -#include "platform/unix_platform.hpp" -#include "platform/win32_platform.hpp" - #define WINFSP_ALLOCATION_UNIT UINT64(4096U) constexpr const auto NANOS_PER_SECOND = 1000000000L; -#ifdef _WIN32 -#ifdef CreateDirectory -#undef CreateDirectory -#endif - -#ifdef CreateFile -#undef CreateFile -#endif - -#ifdef DeleteFile -#undef DeleteFile -#endif - -#ifdef RemoveDirectory -#undef RemoveDirectory -#endif - -#ifndef _SH_DENYRW -#define _SH_DENYRW 0x10 // deny read/write mode -#endif - -#ifndef _SH_DENYWR -#define _SH_DENYWR 0x20 // deny write mode -#endif - -#ifndef _SH_DENYRD -#define _SH_DENYRD 0x30 // deny read mode -#endif - -#ifndef _SH_DENYNO -#define _SH_DENYNO 0x40 // deny none mode -#endif - -#ifndef _SH_SECURE -#define _SH_SECURE 0x80 // secure mode -#endif -#endif - -#ifndef ENETDOWN -#define ENETDOWN 100 -#endif - #ifndef SETATTR_WANTS_MODE #define SETATTR_WANTS_MODE(attr) ((attr)->valid & (1 << 0)) #endif // SETATTR_WANTS_MODE @@ -257,4 +212,7 @@ using FileInfo = FSP_FSCTL_FILE_INFO; using namespace Fsp; +#include "platform/unix_platform.hpp" +#include "platform/win32_platform.hpp" + #endif // INCLUDE_PLATFORM_PLATFORM_HPP_