From 0958e19ffb047781fe1506760c7cbd8d7fe74e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Mon, 2 Dec 2019 14:58:43 +0900 Subject: add several __has_something macro With these macros implemented we can write codes just like we can assume the compiler being clang. MSC_VERSION_SINCE is defined to implement those macros, but turned out to be handy for other places. The -fdeclspec compiler flag is necessary for clang to properly handle __has_declspec(). --- internal/gc.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'internal/gc.h') diff --git a/internal/gc.h b/internal/gc.h index cf59eaed0b..6e3fb8996d 100644 --- a/internal/gc.h +++ b/internal/gc.h @@ -47,11 +47,9 @@ RUBY_SYMBOL_EXPORT_END rb_wb_unprotected_newobj_of(klass, flags)) #define NEWOBJ_OF(obj,type,klass,flags) RB_NEWOBJ_OF(obj,type,klass,flags) -#ifdef __has_attribute #if __has_attribute(alloc_align) __attribute__((__alloc_align__(1))) #endif -#endif void *rb_aligned_malloc(size_t, size_t) RUBY_ATTR_MALLOC RUBY_ATTR_ALLOC_SIZE((2)); size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */ -- cgit v1.2.3