refactor proprocessor directives

This commit is contained in:
2024-07-15 12:20:15 -05:00
parent c1eb6b94ed
commit 6a984ac84c
73 changed files with 1450 additions and 1583 deletions

View File

@ -46,10 +46,14 @@
#endif // defined(__GNUC__)
// clang-format on
#ifdef __cplusplus
#if defined(__cplusplus)
REPERTORY_IGNORE_WARNINGS_ENABLE()
#ifdef _WIN32
#if defined(_WIN32)
#define WINVER 0x0602
#define _WIN32_WINNT WINVER
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
@ -69,20 +73,20 @@ REPERTORY_IGNORE_WARNINGS_ENABLE()
#include <pwd.h>
#include <sys/file.h>
#include <sys/stat.h>
#ifdef __linux__
#if defined(__linux__)
#include <sys/statfs.h>
#endif
#include <unistd.h>
#ifdef HAS_SETXATTR
#if defined(HAS_SETXATTR)
#include <sys/types.h>
#include <sys/xattr.h>
#endif
#ifdef __APPLE__
#if defined(__APPLE__)
#include <libproc.h>
#include <sys/attr.h>
#include <sys/vnode.h>
#endif
#if __APPLE__
#if defined(__APPLE__)
#include <sys/mount.h>
#include <sys/statvfs.h>
#endif
@ -134,7 +138,7 @@ template <typename data_type>
#include "sqlite3.h"
#include "uuid.h"
#ifdef _WIN32
#if defined(_WIN32)
#include <sddl.h>
#include "winfsp/winfsp.hpp"
#else
@ -161,7 +165,7 @@ using json = nlohmann::json;
#define REPERTORY_MIN_REMOTE_VERSION "2.0.0"
#define REPERTORY_W L"repertory"
#ifdef _WIN32
#if defined(_WIN32)
#define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE
#define REPERTORY_API_INVALID_HANDLE static_cast<std::uint64_t>(-1)
using native_handle = HANDLE;
@ -173,20 +177,20 @@ using native_handle = int;
constexpr const auto NANOS_PER_SECOND = 1000000000L;
#ifdef _WIN32
#ifdef CreateDirectory
#if defined(_WIN32)
#if defined(CreateDirectory)
#undef CreateDirectory
#endif
#ifdef CreateFile
#if defined(CreateFile)
#undef CreateFile
#endif
#ifdef DeleteFile
#if defined(DeleteFile)
#undef DeleteFile
#endif
#ifdef RemoveDirectory
#if defined(RemoveDirectory)
#undef RemoveDirectory
#endif
@ -255,8 +259,8 @@ constexpr const auto NANOS_PER_SECOND = 1000000000L;
#define SETATTR_WANTS_FLAGS(attr) ((attr)->valid & (1 << 31))
#endif // SETATTR_WANTS_FLAGS
#ifndef _WIN32
#ifdef __APPLE__
#if !defined(_WIN32)
#if defined(__APPLE__)
#define G_PREFIX "org"
#define G_KAUTH_FILESEC_XATTR G_PREFIX ".apple.system.Security"
#define A_PREFIX "com"
@ -295,7 +299,7 @@ constexpr const auto NANOS_PER_SECOND = 1000000000L;
#define WINFSP_ALLOCATION_UNIT UINT64(4096U)
#ifdef _WIN32
#if defined(_WIN32)
#define UTIME_NOW ((1l << 30) - 1l)
#define UTIME_OMIT ((1l << 30) - 2l)
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) e
@ -346,7 +350,7 @@ using WCHAR = wchar_t;
#define GENERIC_EXECUTE (0x20000000L)
#define GENERIC_ALL (0x10000000L)
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#define INVALID_FILE_ATTRIBUTES ((DWORD) - 1)
#define MAX_PATH 260