diff options
Diffstat (limited to 'include/CompilerKit')
| -rw-r--r-- | include/CompilerKit/AST.h | 3 | ||||
| -rw-r--r-- | include/CompilerKit/CodeGenerator.h | 3 | ||||
| -rw-r--r-- | include/CompilerKit/Detail/Config.h | 2 | ||||
| -rw-r--r-- | include/CompilerKit/Detail/PreConfig.h | 3 | ||||
| -rw-r--r-- | include/CompilerKit/MachO.h | 4 | ||||
| -rw-r--r-- | include/CompilerKit/UUID.h | 2 | ||||
| -rw-r--r-- | include/CompilerKit/Utils/Assembler.h (renamed from include/CompilerKit/Utilities/Assembler.h) | 2 | ||||
| -rw-r--r-- | include/CompilerKit/Utils/Compiler.h (renamed from include/CompilerKit/Utilities/Compiler.h) | 24 | ||||
| -rw-r--r-- | include/CompilerKit/Utils/DLL.h (renamed from include/CompilerKit/Utilities/DLL.h) | 3 |
9 files changed, 25 insertions, 21 deletions
diff --git a/include/CompilerKit/AST.h b/include/CompilerKit/AST.h index 20389c3..c1313ce 100644 --- a/include/CompilerKit/AST.h +++ b/include/CompilerKit/AST.h @@ -1,4 +1,5 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// SPDX-License-Identifier: Apache-2.0 +// 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/ne-foss-org/nectar diff --git a/include/CompilerKit/CodeGenerator.h b/include/CompilerKit/CodeGenerator.h index f2cbe9d..ac42879 100644 --- a/include/CompilerKit/CodeGenerator.h +++ b/include/CompilerKit/CodeGenerator.h @@ -1,4 +1,5 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// SPDX-License-Identifier: Apache-2.0 +// 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/ne-foss-org/nectar diff --git a/include/CompilerKit/Detail/Config.h b/include/CompilerKit/Detail/Config.h index 651904e..3693754 100644 --- a/include/CompilerKit/Detail/Config.h +++ b/include/CompilerKit/Detail/Config.h @@ -16,6 +16,7 @@ #include <ocl/tproc.hpp> namespace CompilerKit { + inline static constexpr int kBaseYear = 1900; using STLString = std::string; using RopeString = ocl::tproc::crope; @@ -63,6 +64,7 @@ inline bool install_signal(Int32 signal, void (*handler)(int)) noexcept { return true; } + } // namespace CompilerKit #endif // __COMPILERKIT_CONFIG_H__ diff --git a/include/CompilerKit/Detail/PreConfig.h b/include/CompilerKit/Detail/PreConfig.h index 882e00b..9294c01 100644 --- a/include/CompilerKit/Detail/PreConfig.h +++ b/include/CompilerKit/Detail/PreConfig.h @@ -87,8 +87,7 @@ #define kObjectFileExt ".obj" #define kBinaryFileExt ".bin" -#define kAsmFileExts \ - { ".64x", ".32x", ".masm", ".s", ".S", ".asm", ".x64" } +#define kAsmFileExts {".64x", ".32x", ".masm", ".s", ".S", ".asm", ".x64"} #define kAsmFileExtsMax (7U) diff --git a/include/CompilerKit/MachO.h b/include/CompilerKit/MachO.h index 05131ad..2942420 100644 --- a/include/CompilerKit/MachO.h +++ b/include/CompilerKit/MachO.h @@ -43,7 +43,9 @@ namespace MachO { constexpr uint32_t kSectionAlign = 4; /// @brief Helper to align a value to page boundary - inline uint64_t AlignToPage(uint64_t value) { return (value + kPageSize - 1) & ~(kPageSize - 1); } + inline uint64_t AlignToPage(uint64_t value) { + return (value + kPageSize - 1) & ~(kPageSize - 1); + } /// @brief Helper to copy segment/section name safely inline void CopySegmentName(char* dest, const char* src) { diff --git a/include/CompilerKit/UUID.h b/include/CompilerKit/UUID.h index a334052..02f95dc 100644 --- a/include/CompilerKit/UUID.h +++ b/include/CompilerKit/UUID.h @@ -165,7 +165,7 @@ namespace Detail { process_byte(static_cast<unsigned char>((bitCount >> 24) & 0xFF)); process_byte(static_cast<unsigned char>((bitCount >> 16) & 0xFF)); process_byte(static_cast<unsigned char>((bitCount >> 8) & 0xFF)); - process_byte(static_cast<unsigned char>((bitCount) &0xFF)); + process_byte(static_cast<unsigned char>((bitCount) & 0xFF)); memcpy(digest, m_digest, 5 * sizeof(uint32_t)); return digest; diff --git a/include/CompilerKit/Utilities/Assembler.h b/include/CompilerKit/Utils/Assembler.h index 8e5821a..6beff60 100644 --- a/include/CompilerKit/Utilities/Assembler.h +++ b/include/CompilerKit/Utils/Assembler.h @@ -8,7 +8,7 @@ #include <CompilerKit/AST.h> #include <CompilerKit/CodeGenerator.h> -#include <CompilerKit/Utilities/Compiler.h> +#include <CompilerKit/Utils/Compiler.h> namespace CompilerKit { /// @brief Get Number from lineBuffer. diff --git a/include/CompilerKit/Utilities/Compiler.h b/include/CompilerKit/Utils/Compiler.h index 0c787ba..094647b 100644 --- a/include/CompilerKit/Utilities/Compiler.h +++ b/include/CompilerKit/Utils/Compiler.h @@ -21,14 +21,14 @@ #define kCode128Section ".code128" #define kData128Section ".data128" -#define kBlank "\e[0;30m" +#define kBlank "\e[0;0m" #define kRed "\e[0;31m" #define kWhite "\e[0;97m" #define kYellow "\e[0;33m" -#define kBlackOverWhite "\E[0;37m" +#define kReset kBlank -#define kStdOut (std::cout << kRed << "Nectar: " << kBlackOverWhite) -#define kStdErr (std::cerr << kRed << "Nectar: " << kBlackOverWhite) +#define kStdOut (std::cout << kRed << "nectar: " << kReset) +#define kStdErr (std::cerr << kRed << "nectar: " << kReset) #define kStdEndl std::endl #define kPrintF kStdOut #define kPrintErr kStdErr @@ -75,24 +75,22 @@ inline void drvi_crash_handler(std::int32_t id) { std::cout << '='; } - std::cout << std::endl; - - std::cout << verbose_header << std::endl; + kStdOut << kStdEndl; + kStdOut << verbose_header << kStdEndl; for (auto& ch : verbose_header) { std::cout << '='; } - std::cout << std::endl; + kStdOut << kStdEndl; - kStdOut << "DATE: " << CompilerKit::current_date() << std::endl; - kStdOut << "VERSION: " << kDistVersion << std::endl; - kStdOut << "ERRNO: " << errno << std::endl; - kStdOut << "ERRNO(STRING): " << strerror(errno) << std::endl; + kStdOut << "DATE: " << CompilerKit::current_date() << kStdEndl; + kStdOut << "VERSION: " << kDistVersion << kStdEndl; + kStdOut << "ERRNO: " << errno << kStdEndl; switch (id) { default: { - kStdOut << "SIGNAL: (" << id << ")." << kBlank << std::endl; + kStdOut << "SIGNAL: (" << id << ")." << kBlank << kStdEndl; break; } } diff --git a/include/CompilerKit/Utilities/DLL.h b/include/CompilerKit/Utils/DLL.h index 461661a..6d12538 100644 --- a/include/CompilerKit/Utilities/DLL.h +++ b/include/CompilerKit/Utils/DLL.h @@ -1,4 +1,5 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// SPDX-License-Identifier: Apache-2.0 +// 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/ne-foss-org/nectar |
