Expose _protected in util.h, useful elsewhere
This commit is contained in:
parent
ca981fbb8e
commit
db3a628c04
@ -17,6 +17,16 @@
|
|||||||
#define likely(cond) __builtin_expect((cond), 1)
|
#define likely(cond) __builtin_expect((cond), 1)
|
||||||
#define unlikely(cond) __builtin_expect((cond), 0)
|
#define unlikely(cond) __builtin_expect((cond), 0)
|
||||||
|
|
||||||
|
#if !defined(__has_attribute)
|
||||||
|
# define __has_attribute(attr) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_attribute(protected)
|
||||||
|
# define _protected __attribute__((protected))
|
||||||
|
#else
|
||||||
|
# define _protected
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(EFI_PLATFORM)
|
#if !defined(_WIN32) && !defined(EFI_PLATFORM)
|
||||||
#define _noexport __attribute__((visibility("hidden")))
|
#define _noexport __attribute__((visibility("hidden")))
|
||||||
#else
|
#else
|
||||||
|
10
src/vm.c
10
src/vm.c
@ -1062,16 +1062,6 @@ const char * krk_typeName(KrkValue value) {
|
|||||||
return krk_getType(value)->name->chars;
|
return krk_getType(value)->name->chars;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__has_attribute)
|
|
||||||
# define __has_attribute(attr) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __has_attribute(protected)
|
|
||||||
# define _protected __attribute__((protected))
|
|
||||||
#else
|
|
||||||
# define _protected
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int _try_op(size_t methodOffset, KrkValue a, KrkValue b, KrkValue *out) {
|
static int _try_op(size_t methodOffset, KrkValue a, KrkValue b, KrkValue *out) {
|
||||||
KrkClass * type = krk_getType(a);
|
KrkClass * type = krk_getType(a);
|
||||||
KrkObj * method = *(KrkObj**)((char*)type + methodOffset);
|
KrkObj * method = *(KrkObj**)((char*)type + methodOffset);
|
||||||
|
Loading…
Reference in New Issue
Block a user