diff options
author | Jack Lloyd <[email protected]> | 2016-10-10 01:50:46 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-10 01:50:46 -0400 |
commit | 227d59d886418ace13aa91c1b0dc5fea91efbb4a (patch) | |
tree | bdf9579874d66acac518ac53ce1ddcde6fb4d719 /src/lib/utils | |
parent | 35657e0f76931f0d3a333610e7065c81c35e9f1e (diff) |
Add IncludeOS target. Make filesystem support optional.
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/data_src.cpp | 9 | ||||
-rw-r--r-- | src/lib/utils/data_src.h | 4 | ||||
-rw-r--r-- | src/lib/utils/os_utils.cpp | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/utils/data_src.cpp b/src/lib/utils/data_src.cpp index 0c06f2fe4..7da94d7c0 100644 --- a/src/lib/utils/data_src.cpp +++ b/src/lib/utils/data_src.cpp @@ -8,9 +8,12 @@ #include <botan/data_src.h> #include <botan/exceptn.h> -#include <fstream> #include <algorithm> +#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) + #include <fstream> +#endif + namespace Botan { /* @@ -98,6 +101,8 @@ DataSource_Memory::DataSource_Memory(const std::string& in) : { } +#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) + /* * Read from a stream */ @@ -209,4 +214,6 @@ DataSource_Stream::~DataSource_Stream() delete m_source_p; } +#endif + } diff --git a/src/lib/utils/data_src.h b/src/lib/utils/data_src.h index 6a100ce63..b24fd75a4 100644 --- a/src/lib/utils/data_src.h +++ b/src/lib/utils/data_src.h @@ -138,6 +138,8 @@ class BOTAN_DLL DataSource_Memory : public DataSource size_t m_offset; }; +#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) + /** * This class represents a Stream-Based DataSource. */ @@ -175,6 +177,8 @@ class BOTAN_DLL DataSource_Stream : public DataSource size_t m_total_read; }; +#endif + } #endif diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp index 2f17da952..56ec59cc0 100644 --- a/src/lib/utils/os_utils.cpp +++ b/src/lib/utils/os_utils.cpp @@ -33,8 +33,10 @@ uint32_t get_process_id() return ::getpid(); #elif defined(BOTAN_TARGET_OS_IS_WINDOWS) || defined(BOTAN_TARGET_OS_IS_MINGW) return ::GetCurrentProcessId(); +#elif defined(BOTAN_TARGET_OS_TYPE_IS_UNIKERNEL) + return 0; #else - throw Exception("get_process_id not supported"); + #error "Missing get_process_id" #endif } |