Skip to content

Commit 0d1eab0

Browse files
committed
cygwin: enable several windows-specific functions
1 parent 003577f commit 0d1eab0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/windows.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include "ffilesystem.h"
1616

17-
#if defined(_WIN32)
17+
#if defined(_WIN32) || defined(__CYGWIN__)
1818
// create type PREPARSE_DATA_BUFFER
1919
// from ntifs.h, which can only be used by drivers
2020
// typedef is copied from https://gitlab.kitware.com/utils/kwsys/-/blob/master/SystemTools.cxx
@@ -62,7 +62,7 @@ typedef struct _REPARSE_DATA_BUFFER
6262
#endif
6363

6464

65-
#if defined(_WIN32)
65+
#if defined(_WIN32) || defined(__CYGWIN__)
6666
static bool fs_win32_get_reparse_buffer(std::string_view path, std::byte* buffer)
6767
{
6868

@@ -132,7 +132,7 @@ bool fs_is_appexec_alias(std::string_view path)
132132
// https://gitlab.kitware.com/utils/kwsys/-/blob/master/SystemTools.cxx
133133
// that has a BSD 3-clause license
134134

135-
#if defined(_WIN32)
135+
#if defined(_WIN32) || defined(__CYGWIN__)
136136
std::byte buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
137137

138138
if (!fs_win32_get_reparse_buffer(path, buffer))
@@ -161,7 +161,7 @@ bool fs_win32_is_symlink(std::string_view path)
161161
// https://gitlab.kitware.com/utils/kwsys/-/blob/master/SystemTools.cxx
162162
// that has a BSD 3-clause license
163163

164-
#if defined(_WIN32)
164+
#if defined(_WIN32) || defined(__CYGWIN__)
165165
std::byte buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
166166
// Since FILE_ATTRIBUTE_REPARSE_POINT is set this file must be
167167
// a symbolic link if it is not a reparse point.
@@ -195,7 +195,7 @@ std::string fs_win32_full_name(std::string_view path)
195195

196196
std::error_code ec;
197197

198-
#if defined(_WIN32)
198+
#if defined(_WIN32) || defined(__CYGWIN__)
199199
std::wstring const w = fs_win32_to_wide(path);
200200

201201
auto const L = GetFullPathNameW(w.data(), 0, nullptr, nullptr);
@@ -232,7 +232,7 @@ std::string fs_win32_final_path(std::string_view path)
232232

233233
std::error_code ec;
234234

235-
#if defined(_WIN32)
235+
#if defined(_WIN32) || defined(__CYGWIN__)
236236
if(fs_trace) std::cout << "TRACE: win32_final_path(" << path << ")\n";
237237
// dwDesiredAccess=0 to allow getting parameters even without read permission
238238
// FILE_FLAG_BACKUP_SEMANTICS required to open a directory

0 commit comments

Comments
 (0)