mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
LibC: Don't use C++ attribute syntax in C-visible headers
Fixes errors when building Clang's compiler-rt, which compiles in C11 more.
This commit is contained in:
parent
3162c9e214
commit
842249aff5
4 changed files with 8 additions and 8 deletions
|
@ -11,7 +11,7 @@
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
[[noreturn]] void __assertion_failed(const char* msg);
|
__attribute__((noreturn)) void __assertion_failed(const char* msg);
|
||||||
# define __stringify_helper(x) # x
|
# define __stringify_helper(x) # x
|
||||||
# define __stringify(x) __stringify_helper(x)
|
# define __stringify(x) __stringify_helper(x)
|
||||||
# define assert(expr) \
|
# define assert(expr) \
|
||||||
|
@ -24,7 +24,7 @@ __BEGIN_DECLS
|
||||||
# define VERIFY_NOT_REACHED() _abort()
|
# define VERIFY_NOT_REACHED() _abort()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[[noreturn]] void _abort();
|
__attribute__((noreturn)) void _abort();
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
# define static_assert _Static_assert
|
# define static_assert _Static_assert
|
||||||
|
|
|
@ -104,7 +104,7 @@ void __cxa_finalize(void* dso_handle)
|
||||||
__pthread_mutex_unlock(&atexit_mutex);
|
__pthread_mutex_unlock(&atexit_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[noreturn]] void __cxa_pure_virtual()
|
__attribute__((noreturn)) void __cxa_pure_virtual()
|
||||||
{
|
{
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ extern "C" {
|
||||||
extern u32 __stack_chk_guard;
|
extern u32 __stack_chk_guard;
|
||||||
u32 __stack_chk_guard = (u32)0xc6c7c8c9;
|
u32 __stack_chk_guard = (u32)0xc6c7c8c9;
|
||||||
|
|
||||||
[[noreturn]] void __stack_chk_fail()
|
__attribute__((noreturn)) void __stack_chk_fail()
|
||||||
{
|
{
|
||||||
dbgln("Error: USERSPACE({}) Stack protector failure, stack smashing detected!", getpid());
|
dbgln("Error: USERSPACE({}) Stack protector failure, stack smashing detected!", getpid());
|
||||||
if (__stdio_is_initialized)
|
if (__stdio_is_initialized)
|
||||||
|
@ -28,7 +28,7 @@ u32 __stack_chk_guard = (u32)0xc6c7c8c9;
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[noreturn]] void __stack_chk_fail_local()
|
__attribute__((noreturn)) void __stack_chk_fail_local()
|
||||||
{
|
{
|
||||||
__stack_chk_fail();
|
__stack_chk_fail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,8 @@ extern bool __stdio_is_initialized;
|
||||||
|
|
||||||
int __cxa_atexit(AtExitFunction exit_function, void* parameter, void* dso_handle);
|
int __cxa_atexit(AtExitFunction exit_function, void* parameter, void* dso_handle);
|
||||||
void __cxa_finalize(void* dso_handle);
|
void __cxa_finalize(void* dso_handle);
|
||||||
[[noreturn]] void __cxa_pure_virtual() __attribute__((weak));
|
__attribute__((noreturn)) void __cxa_pure_virtual() __attribute__((weak));
|
||||||
[[noreturn]] void __stack_chk_fail();
|
__attribute__((noreturn)) void __stack_chk_fail();
|
||||||
[[noreturn]] void __stack_chk_fail_local();
|
__attribute__((noreturn)) void __stack_chk_fail_local();
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue