mirror of
https://github.com/shadps4-emu/ext-fmt.git
synced 2024-12-03 15:51:01 +00:00
Don't use POSIX API on UWP
This commit is contained in:
parent
c58b7d9c2f
commit
9b7fe2a4a1
@ -26,7 +26,12 @@
|
||||
|
||||
#include "format.h"
|
||||
|
||||
#if FMT_HAS_INCLUDE("fcntl.h")
|
||||
// UWP doesn't provide _pipe.
|
||||
#if FMT_HAS_INCLUDE("winapifamily.h")
|
||||
# include <winapifamily.h>
|
||||
#endif
|
||||
#if FMT_HAS_INCLUDE("fcntl.h") && \
|
||||
(!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
|
||||
# include <fcntl.h> // for O_RDONLY
|
||||
# define FMT_USE_FCNTL 1
|
||||
#else
|
||||
@ -60,7 +65,7 @@
|
||||
#ifndef _WIN32
|
||||
# define FMT_RETRY_VAL(result, expression, error_result) \
|
||||
do { \
|
||||
(result) = (expression); \
|
||||
(result) = (expression); \
|
||||
} while ((result) == (error_result) && errno == EINTR)
|
||||
#else
|
||||
# define FMT_RETRY_VAL(result, expression, error_result) result = (expression)
|
||||
|
@ -116,7 +116,6 @@ if (NOT MSVC_BUILD_STATIC)
|
||||
posix-mock-test.cc ../src/format.cc ${TEST_MAIN_SRC})
|
||||
target_include_directories(
|
||||
posix-mock-test PRIVATE ${PROJECT_SOURCE_DIR}/include)
|
||||
target_compile_definitions(posix-mock-test PRIVATE FMT_USE_FILE_DESCRIPTORS=1)
|
||||
target_link_libraries(posix-mock-test gmock)
|
||||
target_include_directories(posix-mock-test SYSTEM PUBLIC gtest gmock)
|
||||
if (FMT_PEDANTIC)
|
||||
|
@ -78,7 +78,7 @@ std::string read(file& f, std::size_t count) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
#endif // FMT_USE_FILE_DESCRIPTORS
|
||||
#endif // FMT_USE_FCNTL
|
||||
|
||||
std::string format_system_error(int error_code, fmt::string_view message) {
|
||||
fmt::memory_buffer out;
|
||||
|
Loading…
Reference in New Issue
Block a user