summaryrefslogtreecommitdiffhomepage
path: root/src/CompilerKit/Config.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-04 12:36:11 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-04 12:36:11 +0100
commit14ed88e58517890f5cce1bb9ab5cfb9e94bcfbf6 (patch)
tree0c3ba10c814187c8ea0891385d210b083dcbb1d8 /src/CompilerKit/Config.h
parentbe042137e28b8baf4a3f703cb0a58f080b1ca642 (diff)
chore: Breaking API changes and work in progress examples for NeCTI SDK.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/CompilerKit/Config.h')
-rw-r--r--src/CompilerKit/Config.h178
1 files changed, 0 insertions, 178 deletions
diff --git a/src/CompilerKit/Config.h b/src/CompilerKit/Config.h
deleted file mode 100644
index 691d51c..0000000
--- a/src/CompilerKit/Config.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license
-
-======================================== */
-
-#ifndef __NECTI_DEFINES_H__
-#define __NECTI_DEFINES_H__
-
-/// =========================================================== ///
-/// @file Config.h
-/// @author Amlal El Mahrouss
-/// @brief Basic defines and types for CompilerKit.
-/// =========================================================== ///
-
-#ifndef Yes
-#define Yes true
-#endif // ifndef Yes
-
-#ifndef No
-#define No false
-#endif // ifndef No
-
-#ifndef YES
-#define YES true
-#endif // ifndef YES
-
-#ifndef NO
-#define NO false
-#endif // ifndef NO
-
-#define SizeType size_t
-
-#define VoidPtr void*
-#define voidPtr VoidPtr
-
-#define UIntPtr uintptr_t
-
-#define Int64 int64_t
-#define UInt64 uint64_t
-
-#define Int32 int
-#define UInt32 unsigned
-
-#define Int16 int16_t
-#define UInt16 uint16_t
-
-#define Int8 int8_t
-#define UInt8 uint8_t
-
-#define Char char
-
-#include <signal.h>
-#include <stdint.h>
-#include <time.h>
-#include <unistd.h>
-#include <cassert>
-#include <string>
-
-#define kDistVersion "v0.0.7-compilerkit"
-#define kDistVersionBCD 0x0002
-
-#define ToString(X) Stringify(X)
-#define Stringify(X) #X
-
-#define kDistRelease ToString(kDistReleaseBranch)
-
-#ifndef kDistRelease
-
-#define kDistVersion "v0.0.7-compilerkit"
-#define kDistVersionBCD 0x0002
-
-#define ToString(X) Stringify(X)
-#define Stringify(X) #X
-
-#define kDistRelease ToString(kDistReleaseBranch)
-
-#endif // !kDistRelease
-
-#define MUST_PASS(E) assert(E)
-
-#ifndef __FORCE_STRLEN
-#define __FORCE_STRLEN 1
-
-#define string_length(len) strlen(len)
-#endif
-
-#ifndef __FORCE_MEMCPY
-#define __FORCE_MEMCPY 1
-
-#define rt_copy_memory(dst, src, len) memcpy(dst, src, len)
-#endif
-
-#define ATTRIBUTE(X) __attribute__((X))
-#define PACKED ATTRIBUTE(packed)
-
-#define kObjectFileExt ".obj"
-#define kBinaryFileExt ".bin"
-
-#define kAsmFileExts {".64x", ".32x", ".masm", ".s", ".S", ".asm", ".x64"}
-
-#define kAsmFileExtsMax (7U)
-
-#define NECTI_MODULE(name) extern "C" int name(int argc, char** argv)
-
-#ifdef MSVC
-#pragma scalar_storage_order big - endian
-#endif // ifdef MSVC
-
-#define NECTI_COPY_DELETE(KLASS) \
- KLASS& operator=(const KLASS&) = delete; \
- KLASS(const KLASS&) = delete;
-
-#define NECTI_COPY_DEFAULT(KLASS) \
- KLASS& operator=(const KLASS&) = default; \
- KLASS(const KLASS&) = default;
-
-#define NECTI_MOVE_DELETE(KLASS) \
- KLASS& operator=(KLASS&&) = delete; \
- KLASS(KLASS&&) = delete;
-
-#define NECTI_MOVE_DEFAULT(KLASS) \
- KLASS& operator=(KLASS&&) = default; \
- KLASS(KLASS&&) = default;
-
-#define CK_IMPORT_C extern "C"
-#define CK_IMPORT extern
-namespace CompilerKit {
-inline constexpr int kBaseYear = 1900;
-
-typedef std::string STLString;
-
-inline STLString current_date() noexcept {
- auto time_data = time(nullptr);
- auto time_struct = gmtime(&time_data);
-
- STLString fmt = std::to_string(kBaseYear + time_struct->tm_year);
-
- fmt += "-";
- fmt += std::to_string(time_struct->tm_mon + 1);
- fmt += "-";
- fmt += std::to_string(time_struct->tm_mday);
-
- return fmt;
-}
-
-inline bool to_str(Char* str, Int32 limit, Int32 base) noexcept {
- if (limit == 0) return false;
-
- Int32 copy_limit = limit;
- Int32 cnt = 0;
- Int32 ret = base;
-
- while (limit != 1) {
- ret = ret % 10;
- str[cnt] = ret;
-
- ++cnt;
- --limit;
- --ret;
- }
-
- str[copy_limit] = '\0';
- return true;
-}
-
-inline bool install_signal(Int32 signal, void (*handler)(int)) noexcept {
- if (handler == nullptr) return false;
-
- if (::signal(signal, handler) == SIG_ERR) {
- return false;
- }
-
- return true;
-}
-} // namespace CompilerKit
-
-#endif /* ifndef __NECTI_DEFINES_H__ */