From f4b1d3d8b751688c5bdc3ff011d0cc2e6e28df73 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 1 Dec 2007 02:52:13 +0000 Subject: [PATCH] glib < 2.8 portability fix --- gtk/conf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk/conf.c b/gtk/conf.c index 381133dae..cf4bfd756 100644 --- a/gtk/conf.c +++ b/gtk/conf.c @@ -255,6 +255,19 @@ pref_save(char **errstr) **** ***/ +#if !GLIB_CHECK_VERSION(2,8,0) +static void +tr_file_set_contents( const char * filename, const void * out, size_t len, GError* unused UNUSED ) +{ + FILE * fp = fopen( filename, "wb+" ); + if( fp != NULL ) { + fwrite( out, 1, len, fp ); + fclose( fp ); + } +} +#define g_file_set_contents tr_file_set_contents +#endif + static char* getCompat08PrefsFilename( void ) {