aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utils')
-rw-r--r--src/lib/utils/data_src.cpp9
-rw-r--r--src/lib/utils/data_src.h4
-rw-r--r--src/lib/utils/os_utils.cpp4
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
}