mruby  2.0.1
mruby is the lightweight implementation of the Ruby language
common.h
Go to the documentation of this file.
1 
7 #ifndef MRUBY_COMMON_H
8 #define MRUBY_COMMON_H
9 
10 #ifdef __APPLE__
11  #ifndef __TARGETCONDITIONALS__
12  #include "TargetConditionals.h"
13  #endif
14 #endif
15 
16 #ifdef __cplusplus
17 #ifdef MRB_ENABLE_CXX_ABI
18 #define MRB_BEGIN_DECL
19 #define MRB_END_DECL
20 #else
21 # define MRB_BEGIN_DECL extern "C" {
22 # define MRB_END_DECL }
23 #endif
24 #else
25 
26 # define MRB_BEGIN_DECL
27 
28 # define MRB_END_DECL
29 #endif
30 
35 
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)
43 #else
44 # define mrb_noreturn
45 #endif
46 
48 #if defined __GNUC__ && !defined __STRICT_ANSI__
49 # define mrb_deprecated __attribute__((deprecated))
50 #elif defined _MSC_VER
51 # define mrb_deprecated __declspec(deprecated)
52 #else
53 # define mrb_deprecated
54 #endif
55 
57 #if defined _MSC_VER && _MSC_VER < 1900
58 # ifndef __cplusplus
59 # define inline __inline
60 # endif
61 #endif
62 #define MRB_INLINE static inline
63 
65 #ifndef MRB_API
66 #if defined(MRB_BUILD_AS_DLL)
67 #if defined(MRB_CORE) || defined(MRB_LIB)
68 # define MRB_API __declspec(dllexport)
69 #else
70 # define MRB_API __declspec(dllimport)
71 #endif
72 #else
73 # define MRB_API extern
74 #endif
75 #endif
76 
78 
79 #endif /* MRUBY_COMMON_H */
#define MRB_BEGIN_DECL
Start declarations in C mode.
Definition: common.h:26
#define MRB_END_DECL
End declarations in C mode.
Definition: common.h:28