diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-08 01:57:30 -0500 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-08 01:57:30 -0500 |
| commit | 2ddaf86857828500235e8b8a65c11bb2dd91b8be (patch) | |
| tree | 46899c14955bf356be2331e63c181afd4089d982 /src/Tools | |
| parent | 9f7c44f1577f194cb76b03ac45a2af542a86c8b9 (diff) | |
chore! breaking API changes and new APIs introduced.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/Tools')
| -rw-r--r-- | src/Tools/cppdrv.cc | 5 | ||||
| -rw-r--r-- | src/Tools/pef-amd64-cxxdrv.cc | 8 | ||||
| -rw-r--r-- | src/Tools/pef-arm64-cdrv.cc | 20 |
3 files changed, 11 insertions, 22 deletions
diff --git a/src/Tools/cppdrv.cc b/src/Tools/cppdrv.cc index 05ffcec..95d4c3a 100644 --- a/src/Tools/cppdrv.cc +++ b/src/Tools/cppdrv.cc @@ -4,14 +4,11 @@ ======================================== */ -/// @file cxxdrv.cc +/// @file cppdrv.cc /// @brief NeCTI frontend preprocessor. #include <CompilerKit/Detail/Config.h> #include <CompilerKit/ErrorID.h> -#include <cstring> -#include <iostream> -#include <vector> CK_IMPORT_C int CPlusPlusPreprocessorMain(int argc, char const* argv[]); diff --git a/src/Tools/pef-amd64-cxxdrv.cc b/src/Tools/pef-amd64-cxxdrv.cc index 9c29a88..fa03d25 100644 --- a/src/Tools/pef-amd64-cxxdrv.cc +++ b/src/Tools/pef-amd64-cxxdrv.cc @@ -4,8 +4,8 @@ ======================================== */ -/// @file cxxdrv.cc -/// @brief NeCTI C++ frontend compiler. +/// @file pef-amd64-cxxdrv.cc +/// @brief NeCTI C++ frontend compiler for AMD64. #include <CompilerKit/Detail/Config.h> #include <CompilerKit/ErrorID.h> @@ -21,10 +21,10 @@ static auto kPath = "/usr/lib/libCompilerKit.so"; static auto kSymbol = "CompilerCPlusPlusAMD64"; Int32 main(Int32 argc, Char const* argv[]) { - CompilerKitDylibTraits dylib; + CompilerKit::DLLTraits dylib; dylib(kPath, kSymbol); - CompilerKitEntrypoint entrypoint_cxx = (CompilerKitEntrypoint) dylib.fEntrypoint; + CompilerKit::DLLTraits::Entrypoint entrypoint_cxx = reinterpret_cast<CompilerKit::DLLTraits::Entrypoint>(dylib.fEntrypoint); if (!entrypoint_cxx) { kStdOut; diff --git a/src/Tools/pef-arm64-cdrv.cc b/src/Tools/pef-arm64-cdrv.cc index 97812b7..3e6c3b2 100644 --- a/src/Tools/pef-arm64-cdrv.cc +++ b/src/Tools/pef-arm64-cdrv.cc @@ -4,8 +4,8 @@ ======================================== */ -/// @file cxxdrv.cc -/// @brief NeCTI C++ frontend compiler. +/// @file pef-arm-cdrv.cc +/// @brief NeCTI ARm64 C frontend compiler. #include <CompilerKit/Detail/Config.h> #include <CompilerKit/ErrorID.h> @@ -21,28 +21,20 @@ static auto kPath = "/usr/lib/libCompilerKit.so"; static auto kSymbol = "CompilerCLangARM64"; Int32 main(Int32 argc, Char const* argv[]) { - CompilerKitDylib handler = dlopen(kPath, RTLD_LAZY | RTLD_GLOBAL); + CompilerKit::DLLTraits dylib; + dylib(kPath, kSymbol); - if (!handler) { - kStdOut; - std::printf("error: Could not load dylib in %s: %s\n", kPath, dlerror()); - - return EXIT_FAILURE; - } - - CompilerKitEntrypoint entrypoint_cxx = (CompilerKitEntrypoint) dlsym(handler, kSymbol); + CompilerKit::DLLTraits::Entrypoint entrypoint_cxx = + reinterpret_cast<CompilerKit::DLLTraits::Entrypoint>(dylib.fEntrypoint); if (!entrypoint_cxx) { kStdOut; std::printf("error: Could not find entrypoint in %s: %s\n", kPath, dlerror()); - dlclose(handler); return EXIT_FAILURE; } auto ret = (entrypoint_cxx(argc, argv) == NECTI_SUCCESS) ? EXIT_SUCCESS : EXIT_FAILURE; - dlclose(handler); - return ret; } |
