From 85ee44f72ee2b65656111a6749f3c6cea6ff33e4 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 5 Dec 2025 08:41:23 -0500 Subject: chore: new version of OCL.Core. Signed-off-by: Amlal El Mahrouss --- include/ocl/allocator_op.hpp | 8 ++++---- include/ocl/crc_hash.hpp | 10 +++------- include/ocl/detail/config.hpp | 24 +++++++++++++++++------- include/ocl/detail/net_config.hpp | 8 +++++--- include/ocl/is_same.hpp | 5 ++++- include/ocl/option.hpp | 6 +++--- include/ocl/print.hpp | 6 +++--- include/ocl/unique_socket.hpp | 5 ++++- 8 files changed, 43 insertions(+), 29 deletions(-) (limited to 'include') diff --git a/include/ocl/allocator_op.hpp b/include/ocl/allocator_op.hpp index f953391..9092800 100644 --- a/include/ocl/allocator_op.hpp +++ b/include/ocl/allocator_op.hpp @@ -1,12 +1,12 @@ /* * File: allocator_op.hpp - * Purpose: Allocator System container. + * Purpose: Allocator Operations container. * Author: Amlal El Mahrouss (amlal@nekernel.org) * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. Licensed under the BSL 1.0 license */ -#ifndef _OCL_ALLOCATOR_SYSTEM_HPP -#define _OCL_ALLOCATOR_SYSTEM_HPP +#ifndef __OCL_CORE_ALLOC +#define __OCL_CORE_ALLOC #include #include @@ -63,4 +63,4 @@ namespace ocl using allocator = allocator_op, global_delete_op>; } // namespace ocl -#endif // ifndef _OCL_ALLOCATOR_SYSTEM_HPP \ No newline at end of file +#endif // ifndef __OCL_CORE_ALLOC \ No newline at end of file diff --git a/include/ocl/crc_hash.hpp b/include/ocl/crc_hash.hpp index cbb757f..f0b155c 100644 --- a/include/ocl/crc_hash.hpp +++ b/include/ocl/crc_hash.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. */ -#ifndef _OCL_CRC32_HPP -#define _OCL_CRC32_HPP +#ifndef __OCL_CORE_CRC_HASH +#define __OCL_CORE_CRC_HASH #include #include @@ -111,10 +111,6 @@ namespace std } }; - // Source - https://stackoverflow.com/a/68521441 - // Posted by StoryTeller - Unslander Monica, modified by community. See post 'Timeline' for change history - // Retrieved 2025-11-30, License - CC BY-SA 4.0 - template struct is_invocable_hash : std::bool_constant < requires(Fn fn, ArgTypes... arg_types) @@ -124,4 +120,4 @@ namespace std } // namespace std -#endif // !_OCL_CRC32_HPP \ No newline at end of file +#endif // !__OCL_CORE_CRC_HASH \ No newline at end of file diff --git a/include/ocl/detail/config.hpp b/include/ocl/detail/config.hpp index c3c01ea..3a85618 100644 --- a/include/ocl/detail/config.hpp +++ b/include/ocl/detail/config.hpp @@ -5,7 +5,8 @@ * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. */ -#pragma once +#ifndef __OCL_CORE_CONFIG +#define __OCL_CORE_CONFIG #include #include @@ -15,18 +16,17 @@ #include #include -#include - -#include -#include - #define OCL_DEPRECATED() [[deprecated]] #define OCL_DEPRECATED_MSG(MSG) [[deprecated(MSG)]] +#if 202002L > __cplusplus +#error !! OCL.Core works with C++20 and greater !! +#endif + #ifdef __cplusplus #define OCL_DECL extern "C" /// DLL/Dylib/So specific macro. -#define OCL_EXPORT_DECL extern "C" BOOST_SYMBOL_EXPORT +#define OCL_EXPORT_DECL extern "C" __attribute__((visibility("default"))) #else #define OCL_DECL #define OCL_EXPORT_DECL @@ -35,4 +35,14 @@ #ifdef _WIN32 #define OCL_USE_CRLF_ENDINGS 1 #define OCL_WINDOWS 1 +#endif + +#ifndef OCL_WINDOWS +#include +#endif + +#if OCL_WANTS_PRAGMA_ONCE +#define OCL_HAS_PRAGMA_ONCE 1 +#endif + #endif \ No newline at end of file diff --git a/include/ocl/detail/net_config.hpp b/include/ocl/detail/net_config.hpp index d5c116d..671d4ba 100644 --- a/include/ocl/detail/net_config.hpp +++ b/include/ocl/detail/net_config.hpp @@ -4,11 +4,11 @@ * Author: Amlal El Mahrouss (amlal@nekernel.org) * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. */ - -#pragma once + +#ifndef __OCL_NET_CONFIG +#define __OCL_NET_CONFIG #include -#include #include #include #include @@ -18,3 +18,5 @@ #ifdef OCL_WINDOWS #error !!! "Windows is not supported yet for " !!! #endif // OCL_WINDOWS + +#endif // __OCL_NET_CONFIG \ No newline at end of file diff --git a/include/ocl/is_same.hpp b/include/ocl/is_same.hpp index 3e9e706..de3425e 100644 --- a/include/ocl/is_same.hpp +++ b/include/ocl/is_same.hpp @@ -5,7 +5,8 @@ * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. */ -#pragma once +#ifndef __OCL_CORE_IS_SAME +#define __OCL_CORE_IS_SAME #include @@ -106,3 +107,5 @@ namespace ocl } }; } // namespace ocl + +#endif \ No newline at end of file diff --git a/include/ocl/option.hpp b/include/ocl/option.hpp index 73cef13..e114b43 100644 --- a/include/ocl/option.hpp +++ b/include/ocl/option.hpp @@ -4,8 +4,8 @@ * Copyright 2023-2025, Amlal El Mahrouss, Licensed under the Boost Software License */ -#ifndef _OCL_OPT_HPP -#define _OCL_OPT_HPP +#ifndef __OCL_CORE_OPTION +#define __OCL_CORE_OPTION #include #include @@ -131,4 +131,4 @@ namespace ocl } } // namespace ocl -#endif /* ifndef _OCL_OPT_HPP */ \ No newline at end of file +#endif /* ifndef __OCL_CORE_OPTION */ \ No newline at end of file diff --git a/include/ocl/print.hpp b/include/ocl/print.hpp index 53c673e..02b3044 100644 --- a/include/ocl/print.hpp +++ b/include/ocl/print.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. Licensed under the BSL 1.0 license */ -#ifndef _OCL_PRINT_HPP -#define _OCL_PRINT_HPP +#ifndef __OCL_CORE_PRINT +#define __OCL_CORE_PRINT #include @@ -74,4 +74,4 @@ namespace ocl::io } } // namespace ocl::io -#endif // ifndef _OCL_PRINT_HPP +#endif // ifndef __OCL_CORE_PRINT diff --git a/include/ocl/unique_socket.hpp b/include/ocl/unique_socket.hpp index a8e532e..c5e67cc 100644 --- a/include/ocl/unique_socket.hpp +++ b/include/ocl/unique_socket.hpp @@ -5,7 +5,8 @@ * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. */ -#pragma once +#ifndef __OCL_CORE_SOCKET +#define __OCL_CORE_SOCKET #include #include @@ -209,3 +210,5 @@ namespace ocl { sock.bad() }; }; } // namespace ocl + +#endif \ No newline at end of file -- cgit v1.2.3