提交 afa75917 编写于 作者: R Rodrigo Kumpera

[build] Add MONO_RT_EXTERNAL_ONLY macro to the public API.

This macro should be used to decorate functions that are part of the public API but the runtime is
not supposed to call.

This is to allow us to keep them around but not go crazy with commit reintroducing their usage.
上级 6a724e9a
......@@ -3651,6 +3651,9 @@ AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
#This must always be defined when building the runtime
AC_DEFINE(MONO_INSIDE_RUNTIME,1, [Disable banned functions from being used by the runtime])
mono_build_root=`pwd`
AC_SUBST(mono_build_root)
......
......@@ -73,6 +73,22 @@ MONO_API void mono_free (void *);
#define MONO_CONST_RETURN const
#if defined (MONO_INSIDE_RUNTIME)
#if defined (__clang__)
#define MONO_RT_EXTERNAL_ONLY __attribute__ ((unavailable("The mono runtime must not call this function")))
#elif defined (__GNUC__)
#define MONO_RT_EXTERNAL_ONLY __attribute__ ((error("The mono runtime must not call this function")))
#else
#define MONO_RT_EXTERNAL_ONLY
#endif /* __clang__ */
#else
#define MONO_RT_EXTERNAL_ONLY
#endif /* MONO_INSIDE_RUNTIME */
MONO_END_DECLS
#endif /* __MONO_PUBLIB_H__ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册