Wed Feb 24 15:50:55 CET 2010 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 24 Feb 2010 15:16:04 +0000 (15:16 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Wed, 24 Feb 2010 15:16:04 +0000 (15:16 -0000)
* mono-publib.h, mono-publib.c: new public header file to allow
the removal of gli from the other public headers.
* Makefile.am: install only the public header mono-publib.h.

svn path=/trunk/mono/; revision=152355

mono/utils/ChangeLog
mono/utils/Makefile.am
mono/utils/mono-publib.c [new file with mode: 0644]
mono/utils/mono-publib.h [new file with mode: 0644]

index 3b185b9df4d9d3644de4269890b24dcd03cc33b2..c9882f4ee86304d03f983573266f5e7aa7a92cb9 100644 (file)
@@ -1,3 +1,10 @@
+
+Wed Feb 24 15:50:55 CET 2010 Paolo Molaro <lupus@ximian.com>
+
+       * mono-publib.h, mono-publib.c: new public header file to allow
+       the removal of gli from the other public headers.
+       * Makefile.am: install only the public header mono-publib.h.
+
 2010-02-19 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * mono-semaphore.h: enable the #defines when io-layer is in use.
index aa011532875c6a4a49ce46b2d043c2216e550761..1b45d2fe8516879374dd09c91914f79e02052383 100644 (file)
@@ -42,6 +42,7 @@ libmonoutils_la_SOURCES = \
        mono-networkinterfaces.h                \
        mono-proclib.c          \
        mono-proclib.h          \
+       mono-publib.c           \
        mono-string.h           \
        mono-time.c             \
        mono-time.h             \
@@ -68,12 +69,6 @@ libmonoutils_la_SOURCES = \
        gc_wrapper.h            \
        mono-error.c    \
        mono-error-internals.h  \
-       valgrind.h      \
-       memcheck.h
-
-libmonoutilsincludedir = $(includedir)/mono-$(API_VER)/mono/utils
-
-libmonoutilsinclude_HEADERS = \
        monobitset.h    \
        mono-codeman.h  \
        mono-counters.h \
@@ -87,6 +82,13 @@ libmonoutilsinclude_HEADERS = \
        mono-path.h     \
        mono-poll.h     \
        mono-uri.h      \
-       mono-stdlib.h
+       mono-stdlib.h   \
+       valgrind.h      \
+       memcheck.h
+
+libmonoutilsincludedir = $(includedir)/mono-$(API_VER)/mono/utils
+
+libmonoutilsinclude_HEADERS = \
+       mono-publib.h
 
 EXTRA_DIST = ChangeLog mono-hash.c mono-hash.h mono-ehash.c
diff --git a/mono/utils/mono-publib.c b/mono/utils/mono-publib.c
new file mode 100644 (file)
index 0000000..70271a5
--- /dev/null
@@ -0,0 +1,10 @@
+#include "config.h"
+#include <mono/utils/mono-publib.h>
+#include <glib.h>
+
+void
+mono_free (void *ptr)
+{
+       g_free (ptr);
+}
+
diff --git a/mono/utils/mono-publib.h b/mono/utils/mono-publib.h
new file mode 100644 (file)
index 0000000..b542492
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef __MONO_PUBLIB_H__
+#define __MONO_PUBLIB_H__
+
+/* 
+ * Minimal general purpose header for use in public mono header files.
+ * We can't include config.h, so we use compiler-specific preprocessor
+ * directives where needed.
+ */
+
+#ifdef  __cplusplus
+#define MONO_BEGIN_DECLS  extern "C" {
+#define MONO_END_DECLS    }
+#else
+#define MONO_BEGIN_DECLS
+#define MONO_END_DECLS
+#endif
+
+MONO_BEGIN_DECLS
+
+#if defined(_MSC_VER)
+
+typedef __int8                 int8_t;
+typedef unsigned __int8                uint8_t;
+typedef __int16                        int16_t;
+typedef unsigned __int16       uint16_t;
+typedef __int32                        int32_t;
+typedef unsigned __int32       uint32_t;
+typedef __int64                        int64_t;
+typedef unsigned __int64       uint64_t;
+
+#else
+
+#include <stdint.h>
+
+#endif /* end of compiler-specific stuff */
+
+typedef int32_t                mono_bool;
+typedef uint8_t                mono_byte;
+typedef uint16_t       mono_unichar2;
+
+typedef void   (*MonoFunc)     (void* data, void* user_data);
+typedef void   (*MonoHFunc)    (void* key, void* value, void* user_data);
+
+void mono_free (void *);
+
+#define MONO_CONST_RETURN const
+
+MONO_END_DECLS
+
+#endif /* __MONO_PUBLIB_H__ */
+