diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/CompilerKit/AE.h | 14 | ||||
| -rw-r--r-- | include/CompilerKit/CodeGenerator.h | 10 | ||||
| -rw-r--r-- | include/CompilerKit/Detail/Config.h | 6 | ||||
| -rw-r--r-- | include/CompilerKit/Detail/PreConfig.h | 2 | ||||
| -rw-r--r-- | include/CompilerKit/Macros.h | 4 | ||||
| -rw-r--r-- | include/CompilerKit/PEF.h | 4 | ||||
| -rw-r--r-- | include/CompilerKit/UUID.h | 34 | ||||
| -rw-r--r-- | include/CompilerKit/Utilities/Compiler.h | 2 | ||||
| -rw-r--r-- | include/CompilerKit/Utilities/DLL.h | 2 | ||||
| -rw-r--r-- | include/ThirdParty/README.md | 9 |
10 files changed, 48 insertions, 39 deletions
diff --git a/include/CompilerKit/AE.h b/include/CompilerKit/AE.h index c69262c..38e4dcc 100644 --- a/include/CompilerKit/AE.h +++ b/include/CompilerKit/AE.h @@ -33,15 +33,15 @@ namespace CompilerKit { // One thing to keep in mind. // This object format, is reloctable. typedef struct AEHeader final { - Char fMagic[kAEMagLen] = {}; + char fMagic[kAEMagLen] = {}; UInt16 fVersion{kAEIdentVersion}; - Char fArch{}; - Char fSubArch{}; + char fArch{}; + char fSubArch{}; SizeType fCount{}; - Char fSize{}; + char fSize{}; SizeType fStartCode{}; SizeType fCodeSize{}; - Char fPad[kAEPad] = {}; + char fPad[kAEPad] = {}; } PACKED AEHeader, *AEHeaderPtr; // @brief Advanced Executable Record. @@ -49,12 +49,12 @@ typedef struct AEHeader final { // fKind must be filled with PEF fields. typedef struct AERecordHeader final { - Char fName[kAESymbolLen]; + char fName[kAESymbolLen]; SizeType fKind; SizeType fSize; SizeType fFlags; UIntPtr fOffset; - Char fPad[kAEPad]; + char fPad[kAEPad]; } PACKED AERecordHeader, *AERecordHeaderPtr; enum { diff --git a/include/CompilerKit/CodeGenerator.h b/include/CompilerKit/CodeGenerator.h index f82441c..c19e978 100644 --- a/include/CompilerKit/CodeGenerator.h +++ b/include/CompilerKit/CodeGenerator.h @@ -81,7 +81,7 @@ union NumberCastBase { static constexpr auto kLimit = 1; - Char number[kLimit]; + char number[kLimit]; UInt64 raw; }; @@ -93,7 +93,7 @@ union NumberCast64 final { static constexpr auto kLimit = 8; - Char number[kLimit]; + char number[kLimit]; UInt64 raw; }; @@ -105,7 +105,7 @@ union NumberCast32 final { static constexpr auto kLimit = 4; - Char number[kLimit]; + char number[kLimit]; UInt32 raw; }; @@ -117,7 +117,7 @@ union NumberCast16 final { static constexpr auto kLimit = 2; - Char number[kLimit]; + char number[kLimit]; UInt16 raw; }; @@ -127,7 +127,7 @@ union NumberCast8 final { ~NumberCast8() { raw = 0; } - Char number; + char number; UInt8 raw; }; diff --git a/include/CompilerKit/Detail/Config.h b/include/CompilerKit/Detail/Config.h index 40a453d..3ab2c04 100644 --- a/include/CompilerKit/Detail/Config.h +++ b/include/CompilerKit/Detail/Config.h @@ -13,10 +13,12 @@ /// =========================================================== /// #include <CompilerKit/Detail/PreConfig.h> +#include <ocl/tproc.hpp> namespace CompilerKit { inline static constexpr int kBaseYear = 1900; -using STLString = std::string; + using STLString = std::string; + using RopeString = ocl::tproc::crope; inline STLString current_date() noexcept { auto time_data = time(nullptr); @@ -32,7 +34,7 @@ inline STLString current_date() noexcept { return fmt; } -inline bool to_str(Char* str, Int32 limit, Int32 base) noexcept { +inline bool to_str(char* str, Int32 limit, Int32 base) noexcept { if (limit == 0) return false; Int32 copy_limit = limit; diff --git a/include/CompilerKit/Detail/PreConfig.h b/include/CompilerKit/Detail/PreConfig.h index 28f1016..d7ea4c6 100644 --- a/include/CompilerKit/Detail/PreConfig.h +++ b/include/CompilerKit/Detail/PreConfig.h @@ -41,8 +41,6 @@ #define Int8 int8_t #define UInt8 uint8_t -#define Char char - #include <signal.h> #include <stdint.h> #include <time.h> diff --git a/include/CompilerKit/Macros.h b/include/CompilerKit/Macros.h index 9030dc4..bf85c60 100644 --- a/include/CompilerKit/Macros.h +++ b/include/CompilerKit/Macros.h @@ -1,9 +1,9 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (See accompanying // file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0) // Official repository: https://github.com/nekernel-org/nectar -/// @brief provide support for Macros.h header. +/// @brief provide support for the CK headers. #ifndef _NECTAR_MACROS_H_ #define _NECTAR_MACROS_H_ diff --git a/include/CompilerKit/PEF.h b/include/CompilerKit/PEF.h index 0c3fd78..f7b88b9 100644 --- a/include/CompilerKit/PEF.h +++ b/include/CompilerKit/PEF.h @@ -83,7 +83,7 @@ enum { /* PEF container information */ typedef struct PEFContainer final { - Char Magic[kPefMagicLen]; + char Magic[kPefMagicLen]; UInt32 Linker; /* Linker used to link executable */ UInt32 Version; UInt32 Kind; @@ -103,7 +103,7 @@ typedef struct PEFContainer final { /* @brief Command Header, a la Mach-O, designed with FAT binaries and virtual memory in mind. */ typedef struct PEFCommandHeader final { - Char Name[kPefNameLen]; /* container name */ + char Name[kPefNameLen]; /* container name */ UInt32 Cpu; /* container cpu */ UInt32 SubCpu; /* container sub-cpu */ UInt32 Flags; /* container flags */ diff --git a/include/CompilerKit/UUID.h b/include/CompilerKit/UUID.h index 2993b8b..02f95dc 100644 --- a/include/CompilerKit/UUID.h +++ b/include/CompilerKit/UUID.h @@ -261,14 +261,14 @@ namespace Detail { size_t m_byteCount; }; - template <typename CharT> - inline constexpr CharT empty_guid[37] = "00000000-0000-0000-0000-000000000000"; + template <typename Char> + inline constexpr Char empty_guid[37] = "00000000-0000-0000-0000-000000000000"; template <> inline constexpr wchar_t empty_guid<wchar_t>[37] = L"00000000-0000-0000-0000-000000000000"; - template <typename CharT> - inline constexpr CharT guid_encoder[17] = "0123456789abcdef"; + template <typename Char> + inline constexpr Char guid_encoder[17] = "0123456789abcdef"; template <> inline constexpr wchar_t guid_encoder<wchar_t>[17] = L"0123456789abcdef"; @@ -349,9 +349,9 @@ enum class uuid_version { // Forward declare uuid & to_string so that we can declare to_string as a friend // later. class uuid; -template <class CharT = char, class Traits = std::char_traits<CharT>, - class Allocator = std::allocator<CharT>> -std::basic_string<CharT, Traits, Allocator> to_string(uuid const& id); +template <class Char = char, class Traits = std::char_traits<char>, + class Allocator = std::allocator<char>> +std::basic_string<Char, Traits, Allocator> to_string(uuid const& id); // -------------------------------------------------------------------------------------------------------------------------- // uuid class @@ -498,8 +498,8 @@ class uuid { friend std::basic_ostream<Elem, Traits>& operator<<(std::basic_ostream<Elem, Traits>& s, uuid const& id); - template <class CharT, class Traits, class Allocator> - friend std::basic_string<CharT, Traits, Allocator> to_string(uuid const& id); + template <class Char, class Traits, class Allocator> + friend std::basic_string<Char, Traits, Allocator> to_string(uuid const& id); friend std::hash<uuid>; }; @@ -520,16 +520,16 @@ class uuid { return lhs.data < rhs.data; } -template <class CharT, class Traits, class Allocator> -[[nodiscard]] inline std::basic_string<CharT, Traits, Allocator> to_string(uuid const& id) { - std::basic_string<CharT, Traits, Allocator> uustr{Detail::empty_guid<CharT>}; +template <class Char, class Traits, class Allocator> +[[nodiscard]] inline std::basic_string<Char, Traits, Allocator> to_string(uuid const& id) { + std::basic_string<char, Traits, Allocator> uustr{Detail::empty_guid<char>}; for (size_t i = 0, index = 0; i < 36; ++i) { if (i == 8 || i == 13 || i == 18 || i == 23) { continue; } - uustr[i] = Detail::guid_encoder<CharT>[id.data[index] >> 4 & 0x0f]; - uustr[++i] = Detail::guid_encoder<CharT>[id.data[index] & 0x0f]; + uustr[i] = Detail::guid_encoder<char>[id.data[index] >> 4 & 0x0f]; + uustr[++i] = Detail::guid_encoder<char>[id.data[index] & 0x0f]; index++; } @@ -679,11 +679,11 @@ class uuid_name_generator { hasher.process_bytes(bytes, 16); } - template <typename CharT, typename Traits> - void process_characters(std::basic_string_view<CharT, Traits> const str) { + template <typename Char, typename Traits> + void process_characters(std::basic_string_view<Char, Traits> const str) { for (uint32_t c : str) { hasher.process_byte(static_cast<uint8_t>(c & 0xFF)); - if constexpr (!std::is_same_v<CharT, char>) { + if constexpr (!std::is_same_v<Char, char>) { hasher.process_byte(static_cast<uint8_t>((c >> 8) & 0xFF)); hasher.process_byte(static_cast<uint8_t>((c >> 16) & 0xFF)); hasher.process_byte(static_cast<uint8_t>((c >> 24) & 0xFF)); diff --git a/include/CompilerKit/Utilities/Compiler.h b/include/CompilerKit/Utilities/Compiler.h index ca577db..42fc977 100644 --- a/include/CompilerKit/Utilities/Compiler.h +++ b/include/CompilerKit/Utilities/Compiler.h @@ -41,7 +41,7 @@ inline static bool kNasmOutput = false; namespace CompilerKit::Detail { /// @brief Blob structure struct Blob final { - std::vector<Char> mBlob{}; // PEF code/bss/data blob. + std::vector<char> mBlob{}; // PEF code/bss/data blob. UIntPtr mOffset{0UL}; // the offset of the PEF container header... explicit operator bool() { return mBlob.empty() && mOffset > 0UL; } diff --git a/include/CompilerKit/Utilities/DLL.h b/include/CompilerKit/Utilities/DLL.h index 26eacea..36c511a 100644 --- a/include/CompilerKit/Utilities/DLL.h +++ b/include/CompilerKit/Utilities/DLL.h @@ -16,7 +16,7 @@ namespace CompilerKit { #ifdef CK_POSIX class ModuleLoader final { public: - using EntryT = Int32 (*)(Int32 argc, Char const* argv[]); + using EntryT = Int32 (*)(Int32 argc, char const* argv[]); using HandleT = VoidPtr; using MutexT = std::mutex; diff --git a/include/ThirdParty/README.md b/include/ThirdParty/README.md new file mode 100644 index 0000000..91bdf73 --- /dev/null +++ b/include/ThirdParty/README.md @@ -0,0 +1,9 @@ +# Third Party: + +You will need: + +- Open C++ Libraries's TProc module. +- Boost 1.90.0+ +- A Modern C++ Compiler. + +In order to compile CompilerKit. |
