mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Move clang-specific consumable annotation helpers to Platform.h
This commit is contained in:
parent
f88c5860df
commit
ecc35876af
Notes:
sideshowbarker
2024-07-19 13:04:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ecc35876af4
@ -4,18 +4,6 @@
|
|||||||
#include <AK/LogStream.h>
|
#include <AK/LogStream.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
|
|
||||||
#ifdef __clang__
|
|
||||||
# define CONSUMABLE(initial_state) __attribute__((consumable(initial_state)))
|
|
||||||
# define CALLABLE_WHEN(...) __attribute__((callable_when(__VA_ARGS__)))
|
|
||||||
# define SET_TYPESTATE(state) __attribute__((set_typestate(state)))
|
|
||||||
# define RETURN_TYPESTATE(state) __attribute__((return_typestate(state)))
|
|
||||||
#else
|
|
||||||
# define CONSUMABLE(initial_state)
|
|
||||||
# define CALLABLE_WHEN(state)
|
|
||||||
# define SET_TYPESTATE(state)
|
|
||||||
# define RETURN_TYPESTATE(state)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -10,3 +10,14 @@
|
|||||||
|
|
||||||
#define ARCH(arch) (defined(AK_ARCH_##arch) && AK_ARCH_##arch)
|
#define ARCH(arch) (defined(AK_ARCH_##arch) && AK_ARCH_##arch)
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
# define CONSUMABLE(initial_state) __attribute__((consumable(initial_state)))
|
||||||
|
# define CALLABLE_WHEN(...) __attribute__((callable_when(__VA_ARGS__)))
|
||||||
|
# define SET_TYPESTATE(state) __attribute__((set_typestate(state)))
|
||||||
|
# define RETURN_TYPESTATE(state) __attribute__((return_typestate(state)))
|
||||||
|
#else
|
||||||
|
# define CONSUMABLE(initial_state)
|
||||||
|
# define CALLABLE_WHEN(state)
|
||||||
|
# define SET_TYPESTATE(state)
|
||||||
|
# define RETURN_TYPESTATE(state)
|
||||||
|
#endif
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/IterationDecision.h>
|
#include <AK/IterationDecision.h>
|
||||||
|
#include <AK/Platform.h>
|
||||||
|
|
||||||
#ifdef __serenity__
|
#ifdef __serenity__
|
||||||
typedef unsigned char u8;
|
typedef unsigned char u8;
|
||||||
|
Loading…
Reference in New Issue
Block a user