diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-24 10:35:32 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-24 10:35:32 +0100 |
| commit | 40498554aa642ac0dbf4ce021df5bbceda5b61e4 (patch) | |
| tree | 2e420ce84f34ce9bbc418bde0e6e07fb2f35f774 | |
| parent | 989092c04649ff07bbb552b2ccc7c9f44569b75c (diff) | |
feat: __CF_64BIT__ macro for CoreFoundation.fwrk.
refactor! Semaphore API breaking changes in the new 'SemaphoreArr' type.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
4 files changed, 16 insertions, 10 deletions
diff --git a/dev/kernel/KernelKit/Semaphore.h b/dev/kernel/KernelKit/Semaphore.h index 1bc61ed1..930b245d 100644 --- a/dev/kernel/KernelKit/Semaphore.h +++ b/dev/kernel/KernelKit/Semaphore.h @@ -14,27 +14,27 @@ #include <KernelKit/Timer.h> #include <NeKit/Defines.h> -#define kSemaphoreOwnerIndex (0) -#define kSemaphoreCountIndex (1) +#define kSemaphoreOwnerIndex (0U) +#define kSemaphoreCountIndex (1U) -#define kSemaphoreCount (2) +#define kSemaphoreCount (2U) #define kSemaphoreIncrementOwner(sem) (sem[kSemaphoreOwnerIndex]++) #define kSemaphoreDecrementOwner(sem) (sem[kSemaphoreOwnerIndex]--) namespace Kernel { /// @brief Semaphore structure used for synchronization. -typedef UInt64 Semaphore[kSemaphoreCount]; +typedef UInt64 SemaphoreArr[kSemaphoreCount]; /// @brief Checks if the semaphore is valid. -inline BOOL rtl_sem_is_valid(const Semaphore& sem, UInt64 owner = 0) { +inline BOOL rtl_sem_is_valid(const SemaphoreArr& sem, UInt64 owner = 0) { return sem[kSemaphoreOwnerIndex] == owner && sem[kSemaphoreCountIndex] >= 0; } /// @brief Releases the semaphore, resetting its owner and count. /// @param sem /// @return -inline BOOL rtl_sem_release(Semaphore& sem) { +inline BOOL rtl_sem_release(SemaphoreArr& sem) { sem[kSemaphoreOwnerIndex] = 0; sem[kSemaphoreCountIndex] = 0; @@ -45,7 +45,7 @@ inline BOOL rtl_sem_release(Semaphore& sem) { /// @param sem /// @param owner /// @return -inline BOOL rtl_sem_acquire(Semaphore& sem, UInt64 owner) { +inline BOOL rtl_sem_acquire(SemaphoreArr& sem, UInt64 owner) { if (!owner) { err_global_get() = kErrorInvalidData; return FALSE; // Invalid owner @@ -61,7 +61,7 @@ inline BOOL rtl_sem_acquire(Semaphore& sem, UInt64 owner) { /// @param sem /// @param timeout /// @return -inline BOOL rtl_sem_wait(Semaphore& sem, UInt64 owner, UInt64 timeout, BOOL* condition = nullptr) { +inline BOOL rtl_sem_wait(SemaphoreArr& sem, UInt64 owner, UInt64 timeout, BOOL* condition = nullptr) { if (!rtl_sem_is_valid(sem, owner)) { return FALSE; } diff --git a/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json b/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json index 076b35ae..39e6b480 100644 --- a/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json +++ b/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json @@ -15,7 +15,8 @@ "kCFVersion=0x0100", "kCFVersionHighest=0x0100", "kCFVersionLowest=0x0100", - "__NE_AMD64__" + "__NE_AMD64__", + "__CF_64BIT__" ] }
\ No newline at end of file diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h index 500ad544..8396a3e8 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h @@ -25,7 +25,7 @@ struct CFPoint; struct CFRect; struct CFColor; -#ifndef __LP64__ +#ifndef __CF_64BIT__ typedef SInt32 CFInteger; typedef float CFReal; #else diff --git a/public/frameworks/CoreFoundation.fwrk/headers/String.h b/public/frameworks/CoreFoundation.fwrk/headers/String.h index c28c05cd..ea32038d 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/String.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/String.h @@ -14,5 +14,10 @@ class CFString; class CFString final CF_OBJECT { public: + CFString() = default; + ~CFString() = default; + + CFString(const CFString&) = delete; + CFString& operator=(const CFString&) = delete; }; } // namespace CF
\ No newline at end of file |
