Merge pull request #2532 from lambdageek/monoerror-mono_object_new
[mono.git] / mono / utils / mono-publib.h
index 505592a862f58f104947341bd80f386c1b589695..30c807043998a61ef995c29c63f3ffe1ac79524d 100644 (file)
@@ -44,14 +44,18 @@ typedef unsigned __int64    uint64_t;
 
 #include <stdint.h>
 
+#ifdef __GNUC__
+#define MONO_API_EXPORT __attribute__ ((visibility ("default")))
+#else
 #define MONO_API_EXPORT
+#endif
 #define MONO_API_IMPORT
 
 #endif /* end of compiler-specific stuff */
 
-#if !defined(MONO_STATIC_BUILD) && defined(MONO_DLL_EXPORT)
+#if defined(MONO_DLL_EXPORT)
        #define MONO_API MONO_API_EXPORT
-#elif !defined(MONO_STATIC_BUILD)
+#elif defined(MONO_DLL_IMPORT)
        #define MONO_API MONO_API_IMPORT
 #else
        #define MONO_API
@@ -60,6 +64,7 @@ typedef unsigned __int64      uint64_t;
 typedef int32_t                mono_bool;
 typedef uint8_t                mono_byte;
 typedef uint16_t       mono_unichar2;
+typedef uint32_t       mono_unichar4;
 
 typedef void   (*MonoFunc)     (void* data, void* user_data);
 typedef void   (*MonoHFunc)    (void* key, void* value, void* user_data);
@@ -68,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__ */