1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 00:30:47 +00:00
serenity/AK/Platform.h
Andreas Kling afc638c3ab AK: Allow NonnullRefPtr::ptr() when in "unknown" typestate.
Clang loses the typestate when passing NonnullRefPtr's via lambda captures.
This is unfortunate, but not much we can do about it. Allowing ptr() makes
it possible to use captured NonnullRefPtrs as you'd expect.
2019-07-25 11:51:24 +02:00

28 lines
717 B
C

#pragma once
#ifdef __i386__
#define AK_ARCH_I386 1
#endif
#ifdef __x86_64__
#define AK_ARCH_X86_64 1
#endif
#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(...)
# define SET_TYPESTATE(state)
# define RETURN_TYPESTATE(state)
#endif
#ifndef __serenity__
#define PAGE_SIZE sysconf(_SC_PAGESIZE)
#endif