From 98193d70485b29b2d9edd9f855579e6ad57e3f90 Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Thu, 29 Aug 2019 17:35:08 -0700 Subject: [PATCH] Fix C++? Commit migrated from https://github.com/mono/mono/commit/8723e49b0efa61d15e2eda74a90ac8a8f7a91b2e --- src/mono/mono/eglib/glib.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mono/mono/eglib/glib.h b/src/mono/mono/eglib/glib.h index 747576d..1ba1477 100644 --- a/src/mono/mono/eglib/glib.h +++ b/src/mono/mono/eglib/glib.h @@ -1416,22 +1416,6 @@ glong g_utf8_pointer_to_offset (const gchar *str, const gchar *pos); #define G_HAVE_API_SUPPORT(x) (x) #define G_UNSUPPORTED_API "%s:%d: '%s' not supported.", __FILE__, __LINE__ #define g_unsupported_api(name) G_STMT_START { g_warning (G_UNSUPPORTED_API, name); } G_STMT_END - -G_END_DECLS - -static inline -void -mono_qsort (void* base, size_t num, size_t size, int (*compare)(const void*, const void*)) -{ - g_assert (compare); - g_assert (size); - if (num < 2 || !size || !base) - return; - qsort (base, num, size, compare); -} - -#define MONO_DECL_CALLBACK(prefix, ret, name, sig) ret (*name) sig; -#define MONO_INIT_CALLBACK(prefix, ret, name, sig) prefix ## _ ## name, // g_free the result // No MAX_PATH limit. @@ -1453,6 +1437,22 @@ mono_get_module_basename (gpointer process, gpointer mod, gunichar2** pstr, guin gboolean mono_get_current_directory (gunichar2** pstr, guint32* plength); +G_END_DECLS // FIXME: There is more extern C than there should be. + +static inline +void +mono_qsort (void* base, size_t num, size_t size, int (*compare)(const void*, const void*)) +{ + g_assert (compare); + g_assert (size); + if (num < 2 || !size || !base) + return; + qsort (base, num, size, compare); +} + +#define MONO_DECL_CALLBACK(prefix, ret, name, sig) ret (*name) sig; +#define MONO_INIT_CALLBACK(prefix, ret, name, sig) prefix ## _ ## name, + // For each allocator; i.e. returning gpointer that needs to be cast. // Macros do not recurse, so naming function and macro the same is ok. // However these are also already macros. -- 2.7.4