summaryrefslogtreecommitdiffhomepage
path: root/include/ocl
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-24 22:13:37 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-24 22:22:17 -0500
commitbf2c4bc8c719159b4ddd1b40e032c449424abd5d (patch)
tree6be8255399cc3e95637c0cd7817ff4c19de02ae6 /include/ocl
parent20748b34ad43f69ec127a4caab05196e2fd38705 (diff)
feat: distribution script fixed, improved linux compat, and extended network unit tests.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/ocl')
-rw-r--r--include/ocl/core/config.hpp10
-rw-r--r--include/ocl/net/modem.hpp3
-rw-r--r--include/ocl/tests/hpptest.hpp17
3 files changed, 22 insertions, 8 deletions
diff --git a/include/ocl/core/config.hpp b/include/ocl/core/config.hpp
index 2ea1399..de1ce76 100644
--- a/include/ocl/core/config.hpp
+++ b/include/ocl/core/config.hpp
@@ -12,10 +12,14 @@
#include <boost/core/demangle.hpp>
#include <boost/core/null_deleter.hpp>
#include <boost/container/allocator.hpp>
+#include <boost/assert.hpp>
-#include <memory>
-#include <iostream>
-#include <string>
+#ifdef __cplusplus
+/// DLL/Dylib/So specific macro.
+# define OCL_EXPORT_DECL extern "C" BOOST_SYMBOL_EXPORT
+#else
+# define OCL_EXPORT_DECL
+#endif
namespace ocl
{
diff --git a/include/ocl/net/modem.hpp b/include/ocl/net/modem.hpp
index 08d5ca5..29db748 100644
--- a/include/ocl/net/modem.hpp
+++ b/include/ocl/net/modem.hpp
@@ -14,6 +14,7 @@
#include <sys/socket.h>
#include <string>
#include <cstddef>
+#include <cstring>
#define OCL_MODEM_INTERFACE : public ocl::net::modem
@@ -23,6 +24,8 @@
namespace ocl::net
{
+ using namespace hpptest;
+
class modem;
/// =============================================================================
diff --git a/include/ocl/tests/hpptest.hpp b/include/ocl/tests/hpptest.hpp
index 0c7b4e5..0b5c54e 100644
--- a/include/ocl/tests/hpptest.hpp
+++ b/include/ocl/tests/hpptest.hpp
@@ -7,8 +7,11 @@
#pragma once
+#include <boost/config.hpp>
+#include <core/config.hpp>
#include <io/print.hpp>
-#include <cstdlib>
+#include <string.h>
+#include <unistd.h>
namespace ocl::hpptest
{
@@ -25,6 +28,10 @@ namespace ocl::hpptest
}
};
+#ifdef __linux__
+ using errno_t = error_t;
+#endif
+
struct posix_terminate final
{
template <bool stop_execution = true, errno_t args>
@@ -40,7 +47,7 @@ namespace ocl::hpptest
typedef bool condition_type;
template <condition_type expr = true>
- consteval inline void must_be()
+ consteval inline void must_pass()
{
#ifdef OCL_HPPTEST
OCL_HPPTEST_ASSERT(expr);
@@ -48,7 +55,7 @@ namespace ocl::hpptest
}
template <condition_type expect, typename on_fail>
- inline void must_be(condition_type cond) noexcept
+ inline void must_pass(condition_type cond) noexcept
{
if (cond != expect)
{
@@ -57,7 +64,7 @@ namespace ocl::hpptest
}
template <errno_t expect = 0>
- inline void must_be(errno_t ern) noexcept
+ inline void must_pass(errno_t ern) noexcept
{
if (ern != expect)
{
@@ -79,7 +86,7 @@ namespace ocl::hpptest
};
template <HRESULT expect = S_OK>
- inline void must_be(HRESULT hr) noexcept
+ inline void must_pass(HRESULT hr) noexcept
{
if (hr != expect)
{