minor fixes for MacOS
This commit is contained in:
		
							parent
							
								
									74fd2c8584
								
							
						
					
					
						commit
						9a084bca66
					
				
							
								
								
									
										15
									
								
								src/setup.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								src/setup.c
									
									
									
									
									
								
							@ -85,12 +85,15 @@ char * Get_program_directory(const char * argv0)
 | 
				
			|||||||
  // MacOSX
 | 
					  // MacOSX
 | 
				
			||||||
  #if defined(__macosx__)
 | 
					  #if defined(__macosx__)
 | 
				
			||||||
    program_dir = malloc(MAXPATHLEN);
 | 
					    program_dir = malloc(MAXPATHLEN);
 | 
				
			||||||
    CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
 | 
					    if (program_dir != NULL)
 | 
				
			||||||
    (void)argv0; // unused
 | 
					    {
 | 
				
			||||||
    CFURLGetFileSystemRepresentation(url,true,(UInt8*)program_dir,MAXPATHLEN);
 | 
					      CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
 | 
				
			||||||
    CFRelease(url);
 | 
					      (void)argv0; // unused
 | 
				
			||||||
    // Append trailing slash
 | 
					      CFURLGetFileSystemRepresentation(url,true,(UInt8*)program_dir,MAXPATHLEN);
 | 
				
			||||||
    strcat(program_dir    ,"/");
 | 
					      CFRelease(url);
 | 
				
			||||||
 | 
					      // Append trailing slash
 | 
				
			||||||
 | 
					      strcat(program_dir    ,"/");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // AmigaOS and alike: hard-coded volume name.
 | 
					  // AmigaOS and alike: hard-coded volume name.
 | 
				
			||||||
  #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
 | 
					  #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
 | 
				
			||||||
 | 
				
			|||||||
@ -360,7 +360,7 @@ void Init_text(void)
 | 
				
			|||||||
  #elif defined(__macosx__)
 | 
					  #elif defined(__macosx__)
 | 
				
			||||||
    // Récupération de la liste des fonts avec fontconfig
 | 
					    // Récupération de la liste des fonts avec fontconfig
 | 
				
			||||||
    #ifndef NOTTF
 | 
					    #ifndef NOTTF
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      int i,number;
 | 
					      int i,number;
 | 
				
			||||||
      char * home_dir = NULL;
 | 
					      char * home_dir = NULL;
 | 
				
			||||||
@ -383,6 +383,7 @@ void Init_text(void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      free(home_dir);
 | 
					      free(home_dir);
 | 
				
			||||||
      //CFRelease(url);
 | 
					      //CFRelease(url);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    #endif
 | 
					    #endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #elif defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__)
 | 
					  #elif defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__)
 | 
				
			||||||
@ -805,4 +806,4 @@ byte *Render_text(const char *str, int font_number, int size, int antialias, int
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    return Render_text_SFont(str, font_number, width, height, palette);
 | 
					    return Render_text_SFont(str, font_number, width, height, palette);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user