glib < 2.8 portability fix

This commit is contained in:
Charles Kerr 2007-12-01 02:52:13 +00:00
parent 57e36bffeb
commit f4b1d3d8b7
1 changed files with 13 additions and 0 deletions

View File

@ -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 )
{