mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	build: Fallback to alphasort() if versionsort() isn't available
versionsort() is a GNU-ism and can't be relied on for non-GNU systems. [modified to define SORTFUNC instead of copying lines by tiwai] Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									df924cd9c5
								
							
						
					
					
						commit
						55abbc9fde
					
				
					 2 changed files with 12 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -3505,7 +3505,12 @@ int snd_config_hook_load(snd_config_t *root, snd_config_t *config, snd_config_t
 | 
			
		|||
			struct dirent **namelist;
 | 
			
		||||
			int n;
 | 
			
		||||
 | 
			
		||||
			n = scandir(fi[idx].name, &namelist, config_filename_filter, versionsort);
 | 
			
		||||
#ifdef _GNU_SOURCE
 | 
			
		||||
#define SORTFUNC	versionsort
 | 
			
		||||
#else
 | 
			
		||||
#define SORTFUNC	alphasort
 | 
			
		||||
#endif
 | 
			
		||||
			n = scandir(fi[idx].name, &namelist, config_filename_filter, SORTFUNC);
 | 
			
		||||
			if (n > 0) {
 | 
			
		||||
				int j;
 | 
			
		||||
				err = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1254,7 +1254,12 @@ int uc_mgr_scan_master_configs(const char **_list[])
 | 
			
		|||
		"%s", env ? env : ALSA_USE_CASE_DIR);
 | 
			
		||||
	filename[MAX_FILE-1] = '\0';
 | 
			
		||||
 | 
			
		||||
	err = scandir(filename, &namelist, filename_filter, versionsort);
 | 
			
		||||
#ifdef _GNU_SOURCE
 | 
			
		||||
#define SORTFUNC	versionsort
 | 
			
		||||
#else
 | 
			
		||||
#define SORTFUNC	alphasort
 | 
			
		||||
#endif
 | 
			
		||||
	err = scandir(filename, &namelist, filename_filter, SORTFUNC);
 | 
			
		||||
	if (err < 0) {
 | 
			
		||||
		err = -errno;
 | 
			
		||||
		uc_error("error: could not scan directory %s: %s",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue