Skip to content

Commit

Permalink
fix compilation for MS-DOS via DJGPP
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixaill committed Apr 1, 2023
1 parent ab956f6 commit 5ff6115
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ set(FMT_SYSTEM_HEADERS_ATTRIBUTE "")
if (FMT_SYSTEM_HEADERS)
set(FMT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM)
endif ()
if(CMAKE_SYSTEM_NAME STREQUAL "MSDOS")
set(FMT_TEST OFF)
message(STATUS "MSDOS is incompatible with gtest")
endif()

# Get version from core.h
file(READ include/fmt/core.h core_h)
Expand Down Expand Up @@ -375,3 +379,8 @@ if (FMT_MASTER_PROJECT AND EXISTS ${gitignore})
set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.rst)
include(CPack)
endif ()

add_executable(demo)
target_sources(demo PRIVATE demo/main.cpp)
target_link_libraries(demo PRIVATE fmt)

3 changes: 3 additions & 0 deletions demo/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//
// Created by mixai on 01.04.23.
//
2 changes: 2 additions & 0 deletions src/os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ file file::open_windows_file(wcstring_view path, int oflag) {
}
# endif

#if !defined(__MSDOS__)
long getpagesize() {
# ifdef _WIN32
SYSTEM_INFO si;
Expand All @@ -384,6 +385,7 @@ long getpagesize() {
return size;
# endif
}
#endif

FMT_BEGIN_DETAIL_NAMESPACE

Expand Down

0 comments on commit 5ff6115

Please sign in to comment.