mirror of https://github.com/tstellar/bygfoot.git
Fix build with glib < 2.62
This commit is contained in:
parent
f6eada0ed4
commit
7cb15b645c
|
@ -43,7 +43,11 @@ debug_print_message(gchar *format, ...)
|
||||||
gchar buf[SMALL];
|
gchar buf[SMALL];
|
||||||
const gchar *home;
|
const gchar *home;
|
||||||
FILE *fil = NULL;
|
FILE *fil = NULL;
|
||||||
|
#ifdef GLIB_VERSION_2_62
|
||||||
GDateTime *logtime;
|
GDateTime *logtime;
|
||||||
|
#else
|
||||||
|
GTimeVal logtime;
|
||||||
|
#endif
|
||||||
gchar *logtime_string;
|
gchar *logtime_string;
|
||||||
|
|
||||||
if(format != NULL)
|
if(format != NULL)
|
||||||
|
@ -58,10 +62,15 @@ debug_print_message(gchar *format, ...)
|
||||||
|
|
||||||
if(debug_output != DEBUG_OUT_STDOUT)
|
if(debug_output != DEBUG_OUT_STDOUT)
|
||||||
{
|
{
|
||||||
|
#ifdef GLIB_VERSION_2_62
|
||||||
gint64 current_time = g_get_real_time();
|
gint64 current_time = g_get_real_time();
|
||||||
logtime = g_date_time_new_from_unix_utc(current_time);
|
logtime = g_date_time_new_from_unix_utc(current_time);
|
||||||
logtime_string = g_date_time_format_iso8601(logtime);
|
logtime_string = g_date_time_format_iso8601(logtime);
|
||||||
g_date_time_unref(logtime);
|
g_date_time_unref(logtime);
|
||||||
|
#else
|
||||||
|
g_get_current_time(&logtime);
|
||||||
|
logtime_string = g_time_val_to_iso8601(&logtime);
|
||||||
|
#endif
|
||||||
|
|
||||||
sprintf(text, "%s %s\n", logtime_string, buf);
|
sprintf(text, "%s %s\n", logtime_string, buf);
|
||||||
g_free(logtime_string);
|
g_free(logtime_string);
|
||||||
|
|
|
@ -686,7 +686,16 @@ handle_required_reserve_relegation(const TeamMove *move, GArray *team_movements)
|
||||||
/* We have found the last relegation for this league, so
|
/* We have found the last relegation for this league, so
|
||||||
* insert the new_move here. */
|
* insert the new_move here. */
|
||||||
gint insert_index = k + 1;
|
gint insert_index = k + 1;
|
||||||
|
#ifdef GLIB_VERSION_2_62
|
||||||
new_move.dest_idcs = g_array_copy(move->dest_idcs);
|
new_move.dest_idcs = g_array_copy(move->dest_idcs);
|
||||||
|
#else
|
||||||
|
new_move.dest_idcs = g_array_sized_new(FALSE, FALSE,
|
||||||
|
sizeof(gint),
|
||||||
|
move->dest_idcs->len);
|
||||||
|
g_array_append_vals(new_move.dest_idcs,
|
||||||
|
move->dest_idcs->data,
|
||||||
|
move->dest_idcs->len);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(debug > 70) {
|
if(debug > 70) {
|
||||||
printf("Adding relegation of %s\n", reserve_team->name);
|
printf("Adding relegation of %s\n", reserve_team->name);
|
||||||
|
|
Loading…
Reference in New Issue