From 4a0771569b0bd8844ab7aef7ededa3428939d91d Mon Sep 17 00:00:00 2001 From: Matthew Johnson Date: Fri, 1 Nov 2024 23:42:15 +0000 Subject: [PATCH] Fixing mac build Signed-off-by: Matthew Johnson --- CMakeLists.txt | 41 +---------------------------------------- include/npy/core.h | 4 ++-- 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9424c5d..3775166 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,46 +26,7 @@ option( LIBNPY_BUILD_DOCUMENTATION "Specifies whether to build the documentation option( LIBNPY_INCLUDE_CSHARP "Specifies whether to build libnpy with C# bindings" OFF ) set( LIBNPY_SANITIZE "" CACHE STRING "Argument to pass to sanitize (disabled by default)") -# ------------------- Detect the system ----------------------- - -if( APPLE ) - set( SYSTEM_NAME "Mac" ) - set( LIBNPY_NUGET_LIB "libnpy.a") - set( SYSTEM_TOOLKIT "${CMAKE_CXX_COMPILER_VERSION}") -elseif( UNIX ) - set( SYSTEM_NAME "Linux" ) - set( LIBNPY_NUGET_LIB "libnpy.a") - execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE LSB_ID) - execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE LSB_RELEASE) - if( LSB_ID AND LSB_RELEASE ) - string(STRIP "${LSB_ID}" LSB_ID) - string(STRIP "${LSB_RELEASE}" LSB_RELEASE) - set( SYSTEM_NAME "${SYSTEM_NAME}-${LSB_ID}-${LSB_RELEASE}") - elseif( EXISTS "/etc/debian_version") - file( READ /etc/debian_version DEBIAN_VERSION ) - set( SYSTEM_NAME "${SYSTEM_NAME}-${DEBIAN_VERSION}") - elseif( EXISTS "/etc/os-release") - execute_process(COMMAND "sed" "-ne" "s/^ID=\"\\?\\([a-z]\\+\\)\"\\?$/\\1/p" "/etc/os-release" OUTPUT_VARIABLE OS_RELEASE_ID OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND "sed" "-ne" "s/^VERSION_ID=\"\\?\\([0-9\\.]\\+\\)\"\\?$/\\1/p" "/etc/os-release" OUTPUT_VARIABLE OS_RELEASE_VERSION_ID OUTPUT_STRIP_TRAILING_WHITESPACE) - set( SYSTEM_NAME "${SYSTEM_NAME}-${OS_RELEASE_ID}-${OS_RELEASE_VERSION_ID}") - elseif( EXISTS "/etc/redhat-release") - set( SYSTEM_NAME "${SYSTEM_NAME}-Redhat") - endif() - set( SYSTEM_TOOLKIT "gcc${CMAKE_CXX_COMPILER_VERSION}") -elseif( WIN32 ) - set( LIBNPY_NUGET_LIB "npy.lib") - set( SYSTEM_NAME "Windows" ) - set( SYSTEM_TOOLKIT "v${MSVC_TOOLSET_VERSION}") -endif() - -if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) - set( SYSTEM_NAME "${SYSTEM_NAME}-64bit" ) - set( SYSTEM_BITS "x64" ) -else() - set( SYSTEM_NAME "${SYSTEM_NAME}-32bit" ) - set( SYSTEM_BITS "x86" ) -endif() - +set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # -------------------- Find packages -------------------------- diff --git a/include/npy/core.h b/include/npy/core.h index d787ec5..2b4bd89 100644 --- a/include/npy/core.h +++ b/include/npy/core.h @@ -118,9 +118,9 @@ class membuf : public std::basic_streambuf { std::streamsize showmanyc() override; std::streamsize xsgetn(std::uint8_t *s, std::streamsize n) override; int_type underflow() override; - int_type pbackfail(int_type c = traits_type::eof()) override; + int_type pbackfail(int_type c = std::char_traits::eof()) override; std::streamsize xsputn(const std::uint8_t *s, std::streamsize n) override; - int_type overflow(int_type c = traits_type::eof()) override; + int_type overflow(int_type c = std::char_traits::eof()) override; private: std::vector m_buffer;