2 **"common.h - mruby common platform definition"
4 ** See Copyright Notice in mruby.h
11 #ifndef __TARGETCONDITIONALS__
12 #include "TargetConditionals.h"
17 #ifdef MRB_ENABLE_CXX_ABI
18 #define MRB_BEGIN_DECL
21 # define MRB_BEGIN_DECL extern "C" {
22 # define MRB_END_DECL }
25 /** Start declarations in C mode */
26 # define MRB_BEGIN_DECL
27 /** End declarations in C mode */
32 * Shared compiler macros
36 /** Declare a function that never returns. */
37 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L
38 # define mrb_noreturn _Noreturn
39 #elif defined __GNUC__ && !defined __STRICT_ANSI__
40 # define mrb_noreturn __attribute__((noreturn))
41 #elif defined _MSC_VER
42 # define mrb_noreturn __declspec(noreturn)
47 /** Mark a function as deprecated. */
48 #if defined __GNUC__ && !defined __STRICT_ANSI__
49 # define mrb_deprecated __attribute__((deprecated))
50 #elif defined _MSC_VER
51 # define mrb_deprecated __declspec(deprecated)
53 # define mrb_deprecated
56 /** Declare a function as always inlined. */
58 # define MRB_INLINE static __inline
60 # define MRB_INLINE static inline
64 /** Declare a public MRuby API function. */
65 #if defined(MRB_BUILD_AS_DLL)
66 #if defined(MRB_CORE) || defined(MRB_LIB)
67 # define MRB_API __declspec(dllexport)
69 # define MRB_API __declspec(dllimport)
72 # define MRB_API extern
77 #endif /* MRUBY_COMMON_H */