diff options
Diffstat (limited to 'src/libSystem/SystemKit')
| -rw-r--r-- | src/libSystem/SystemKit/Err.h | 5 | ||||
| -rw-r--r-- | src/libSystem/SystemKit/Jail.h | 5 | ||||
| -rw-r--r-- | src/libSystem/SystemKit/Macros.h | 5 | ||||
| -rw-r--r-- | src/libSystem/SystemKit/Syscall.h | 5 | ||||
| -rw-r--r-- | src/libSystem/SystemKit/Verify.h | 10 |
5 files changed, 21 insertions, 9 deletions
diff --git a/src/libSystem/SystemKit/Err.h b/src/libSystem/SystemKit/Err.h index ea36abde..7e8dbee4 100644 --- a/src/libSystem/SystemKit/Err.h +++ b/src/libSystem/SystemKit/Err.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef SYSTEMKIT_ERR_H +#define SYSTEMKIT_ERR_H #include <libSystem/SystemKit/Macros.h> @@ -56,3 +57,5 @@ inline constexpr ErrRef kErrorUnimplemented = -1; /// @brief The last error reported by the system to the process. IMPORT_C ErrRef kLastError; + +#endif diff --git a/src/libSystem/SystemKit/Jail.h b/src/libSystem/SystemKit/Jail.h index f28968b4..acf392b4 100644 --- a/src/libSystem/SystemKit/Jail.h +++ b/src/libSystem/SystemKit/Jail.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef SYSTEMKIT_JAIL_H +#define SYSTEMKIT_JAIL_H #include <libSystem/SystemKit/System.h> @@ -34,3 +35,5 @@ struct JAIL { /// @brief Get the current jail /// @return Pointer to the current jail structure, or NULL if not in a jail IMPORT_C struct JAIL* JailGetCurrent(Void); + +#endif diff --git a/src/libSystem/SystemKit/Macros.h b/src/libSystem/SystemKit/Macros.h index b30db701..dab30384 100644 --- a/src/libSystem/SystemKit/Macros.h +++ b/src/libSystem/SystemKit/Macros.h @@ -7,7 +7,8 @@ Purpose: libsci Macros header. ======================================== */ -#pragma once +#ifndef SYSTEMKIT_MACROS_H +#define SYSTEMKIT_MACROS_H /***********************************************************************************/ /// @file libSystem/Macros.h @@ -124,3 +125,5 @@ typedef nullPtr NullPtr; #define LIBSYS_UNUSED(X) ((void) X) IMPORT_C void _rtl_assert(Bool expr, const Char* origin); + +#endif diff --git a/src/libSystem/SystemKit/Syscall.h b/src/libSystem/SystemKit/Syscall.h index 58d7d7f1..1d30782f 100644 --- a/src/libSystem/SystemKit/Syscall.h +++ b/src/libSystem/SystemKit/Syscall.h @@ -4,7 +4,8 @@ ======================================== */ -#pragma once +#ifndef SYSTEMKIT_SYSCALL_H +#define SYSTEMKIT_SYSCALL_H #include <libSystem/SystemKit/System.h> #include <cstdarg> @@ -19,3 +20,5 @@ IMPORT_C UInt64 libsys_hash_64(const Char* path); #ifndef SYSCALL_HASH #define SYSCALL_HASH(str) libsys_hash_64(str) #endif // !SYSCALL_HASH + +#endif diff --git a/src/libSystem/SystemKit/Verify.h b/src/libSystem/SystemKit/Verify.h index c584ac82..0bdfd2ca 100644 --- a/src/libSystem/SystemKit/Verify.h +++ b/src/libSystem/SystemKit/Verify.h @@ -7,7 +7,8 @@ ======================================== */ -#pragma once +#ifndef SYSTEMKIT_VERIFY_H +#define SYSTEMKIT_VERIFY_H #include <libSystem/SystemKit/System.h> @@ -15,14 +16,11 @@ namespace LibSystem::Verify { /// @author 0xf00sec, and Amlal El Mahrouss /// @brief safe cast operator. template <class T, class R> -inline R sys_safe_cast(const T* ptr) { +inline R* sys_safe_cast(const T* ptr) { ::_rtl_assert(ptr, "safe cast failed!"); return static_cast<R*>(const_cast<T*>(ptr)); } -template <class T, class R = Void> -inline Void sys_safe_cast(const T* ptr) = delete; - template <class T, class U> struct is_castable { using return_type = U; @@ -45,3 +43,5 @@ constexpr R* sys_constexpr_cast(T* ptr) { return static_cast<R*>(ptr); } } // namespace LibSystem::Verify + +#endif |
