Ticket #63344: glib-tiger-compat.diff

File glib-tiger-compat.diff, 1.3 KB (added by evanmiller (Evan Miller), 3 years ago)

Workaround for Tiger/Leopard warnings and errors

  • glib/gosxutils.m

    old new  
    3333  NSArray *paths;
    3434
    3535  paths = NSSearchPathForDirectoriesInDomains (type, NSUserDomainMask, YES);
     36#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
    3637  path = [paths firstObject];
     38#else
     39  path = [paths count] ? [paths objectAtIndex:0] : NULL;
     40#endif
    3741  if (path == nil)
    3842    {
    3943      return NULL;
     
    4953{
    5054  table[G_USER_DIRECTORY_DESKTOP] = find_folder (NSDesktopDirectory);
    5155  table[G_USER_DIRECTORY_DOCUMENTS] = find_folder (NSDocumentDirectory);
     56#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
    5257  table[G_USER_DIRECTORY_DOWNLOAD] = find_folder (NSDownloadsDirectory);
    5358  table[G_USER_DIRECTORY_MUSIC] = find_folder (NSMusicDirectory);
    5459  table[G_USER_DIRECTORY_PICTURES] = find_folder (NSPicturesDirectory);
    5560  table[G_USER_DIRECTORY_PUBLIC_SHARE] = find_folder (NSSharedPublicDirectory);
    5661  table[G_USER_DIRECTORY_TEMPLATES] = NULL;
    5762  table[G_USER_DIRECTORY_VIDEOS] = find_folder (NSMoviesDirectory);
    58 }
    59  No newline at end of file
     63#else
     64  table[G_USER_DIRECTORY_DOWNLOAD] = NULL;
     65  table[G_USER_DIRECTORY_MUSIC] = NULL;
     66  table[G_USER_DIRECTORY_PICTURES] = NULL;
     67  table[G_USER_DIRECTORY_PUBLIC_SHARE] = NULL;
     68  table[G_USER_DIRECTORY_TEMPLATES] = NULL;
     69  table[G_USER_DIRECTORY_VIDEOS] = NULL;
     70#endif
     71}