Skip to content

Commit

Permalink
[mono] Assume C99 support (#51504)
Browse files Browse the repository at this point in the history
We don't seem to have been setting this define properly, but we can just remove the ifdef entirely
  • Loading branch information
CoffeeFlux committed May 4, 2021
1 parent bde0bab commit 788a85e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
10 changes: 1 addition & 9 deletions src/mono/mono/eglib/glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,20 +789,12 @@ void mono_assertion_message_unreachable (const char *file, int line) G
const char * g_get_assertion_message (void);

#ifndef DISABLE_ASSERT_MESSAGES
#ifdef HAVE_C99_SUPPORT
/* The for (;;) tells gc thats g_error () doesn't return, avoiding warnings */
#define g_error(format, ...) do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, __VA_ARGS__); for (;;); } while (0)
#define g_critical(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, __VA_ARGS__)
#define g_warning(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, __VA_ARGS__)
#define g_message(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, __VA_ARGS__)
#define g_debug(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, __VA_ARGS__)
#else /* HAVE_C99_SUPPORT */
#define g_error(...) do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
#define g_error(...) do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
#define g_critical(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, __VA_ARGS__)
#define g_warning(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, __VA_ARGS__)
#define g_message(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
#define g_debug(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
#endif /* ndef HAVE_C99_SUPPORT */
#else
#define g_error(...) do { g_log_disabled (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __FILE__, __LINE__); for (;;); } while (0)
#define g_critical(...) g_log_disabled (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, __FILE__, __LINE__)
Expand Down
13 changes: 0 additions & 13 deletions src/mono/mono/mini/cfgdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,12 @@
#define CFG_DEBUG
#endif


#ifdef CFG_DEBUG

#ifdef HAVE_C99_SUPPORT
#define cfg_debug(format, ...) g_debug(format, __VA_ARGS__)
#else
#define cfg_debug(...) g_debug(__VA_ARGS__)
#endif

#else

#ifdef HAVE_C99_SUPPORT
#define cfg_debug(format, ...) do {} while (0)
#else
#define cfg_debug(...) do {} while (0)
#endif

#endif

static ConstantPoolEntry*
create_cp_entry (MonoCompile *cfg, void *data, pool_type pt)
{
Expand Down

0 comments on commit 788a85e

Please sign in to comment.