Fix to compile using XCode
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
fb66eeb852
commit
b326f819ab
@ -92,3 +92,9 @@
|
|||||||
#else
|
#else
|
||||||
#define _Deprecated_(message) [[deprecated(message)]]
|
#define _Deprecated_(message) [[deprecated(message)]]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define _Unreferenced_(x) UNREFERENCED_PARAMETER(x)
|
||||||
|
#else
|
||||||
|
#define _Unreferenced_(x)
|
||||||
|
#endif
|
||||||
|
@ -87,8 +87,8 @@ namespace stdex
|
|||||||
virtual _Success_(return != 0 || length == 0) size_t read(
|
virtual _Success_(return != 0 || length == 0) size_t read(
|
||||||
_Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
|
_Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(data);
|
_Unreferenced_(data);
|
||||||
UNREFERENCED_PARAMETER(length);
|
_Unreferenced_(length);
|
||||||
m_state = state_t::fail;
|
m_state = state_t::fail;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -105,8 +105,8 @@ namespace stdex
|
|||||||
virtual _Success_(return != 0) size_t write(
|
virtual _Success_(return != 0) size_t write(
|
||||||
_In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
|
_In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(data);
|
_Unreferenced_(data);
|
||||||
UNREFERENCED_PARAMETER(length);
|
_Unreferenced_(length);
|
||||||
m_state = state_t::fail;
|
m_state = state_t::fail;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -753,8 +753,8 @@ namespace stdex
|
|||||||
///
|
///
|
||||||
virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
|
virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(offset);
|
_Unreferenced_(offset);
|
||||||
UNREFERENCED_PARAMETER(length);
|
_Unreferenced_(length);
|
||||||
throw std::exception("not implemented");
|
throw std::exception("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,8 +763,8 @@ namespace stdex
|
|||||||
///
|
///
|
||||||
virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
|
virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(offset);
|
_Unreferenced_(offset);
|
||||||
UNREFERENCED_PARAMETER(length);
|
_Unreferenced_(length);
|
||||||
throw std::exception("not implemented");
|
throw std::exception("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -808,7 +808,7 @@ namespace stdex
|
|||||||
///
|
///
|
||||||
virtual void set_ctime(time_point date)
|
virtual void set_ctime(time_point date)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(date);
|
_Unreferenced_(date);
|
||||||
throw std::exception("not implemented");
|
throw std::exception("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -817,7 +817,7 @@ namespace stdex
|
|||||||
///
|
///
|
||||||
virtual void set_atime(time_point date)
|
virtual void set_atime(time_point date)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(date);
|
_Unreferenced_(date);
|
||||||
throw std::exception("not implemented");
|
throw std::exception("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -826,7 +826,7 @@ namespace stdex
|
|||||||
///
|
///
|
||||||
virtual void set_mtime(time_point date)
|
virtual void set_mtime(time_point date)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(date);
|
_Unreferenced_(date);
|
||||||
throw std::exception("not implemented");
|
throw std::exception("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: MIT
|
SPDX-License-Identifier: MIT
|
||||||
Copyright © 2023 Amebis
|
Copyright © 2023 Amebis
|
||||||
*/
|
*/
|
||||||
@ -136,12 +136,12 @@ namespace stdex
|
|||||||
///
|
///
|
||||||
/// Closes object
|
/// Closes object
|
||||||
///
|
///
|
||||||
static void close(sys_handle h)
|
static void close(_In_ sys_handle h)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (CloseHandle(h) || GetLastError() == ERROR_INVALID_HANDLE)
|
if (CloseHandle(h) || GetLastError() == ERROR_INVALID_HANDLE)
|
||||||
#else
|
#else
|
||||||
if (close(h) >= 0 || errno == EBADF)
|
if (::close(h) >= 0 || errno == EBADF)
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
throw std::runtime_error("failed to close handle");
|
throw std::runtime_error("failed to close handle");
|
||||||
@ -157,7 +157,7 @@ namespace stdex
|
|||||||
HANDLE process = GetCurrentProcess();
|
HANDLE process = GetCurrentProcess();
|
||||||
if (DuplicateHandle(process, h, process, &h_new, 0, inherit, DUPLICATE_SAME_ACCESS))
|
if (DuplicateHandle(process, h, process, &h_new, 0, inherit, DUPLICATE_SAME_ACCESS))
|
||||||
#else
|
#else
|
||||||
UNREFERENCED_PARAMETER(inherit);
|
_Unreferenced_(inherit);
|
||||||
if ((h_new = dup(h)) >= 0)
|
if ((h_new = dup(h)) >= 0)
|
||||||
#endif
|
#endif
|
||||||
return h_new;
|
return h_new;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user