Ticket #3430: mc-indroduct-wundef-check-01.patch
File mc-indroduct-wundef-check-01.patch, 2.7 KB (added by and, 10 years ago) |
---|
-
configure.ac
introduce -Wundef check to catch macro typos more infos about motivation at https://sourceware.org/glibc/wiki/Wundef patch 01/04: use always defined MC_HOMEDIR_XDG macro Signed-off-by: Andreas Mohr <and@gmx.li>
a b 376 376 AC_DEFINE(MC_HOMEDIR_XDG, 1, 377 377 [Define to enable XDG standard support]) 378 378 else 379 AC_DEFINE(MC_HOMEDIR_XDG, 0, 380 [Define to enable XDG standard support]) 379 381 AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME]) 380 382 fi 381 383 -
lib/mcconfig/paths.c
a b 102 102 /* *INDENT-ON* */ 103 103 }; 104 104 105 #if defMC_HOMEDIR_XDG105 #if MC_HOMEDIR_XDG 106 106 static const struct 107 107 { 108 108 char **old_basedir; … … 286 286 mc_config_init_config_paths (GError ** mcerror) 287 287 { 288 288 char *dir; 289 #if ndef MC_HOMEDIR_XDG289 #if MC_HOMEDIR_XDG == 0 290 290 char *defined_userconf_dir; 291 291 #endif 292 292 mc_return_if_error (mcerror); … … 297 297 /* init mc_home and homedir if not yet */ 298 298 (void) mc_config_get_home_dir (); 299 299 300 #if defMC_HOMEDIR_XDG300 #if MC_HOMEDIR_XDG 301 301 if (mc_home != NULL) 302 302 { 303 303 dir = g_build_filename (mc_home, ".config", (char *) NULL); … … 374 374 return; 375 375 376 376 g_free (mc_config_str); 377 #if defMC_HOMEDIR_XDG377 #if MC_HOMEDIR_XDG 378 378 g_free (mc_cache_str); 379 379 g_free (mc_data_str); 380 380 #endif /* MC_HOMEDIR_XDG */ … … 452 452 old_dir = mc_config_get_deprecated_path (); 453 453 454 454 g_free (mc_config_init_one_config_path (mc_config_str, EDIT_DIR, mcerror)); 455 #if defMC_HOMEDIR_XDG455 #if MC_HOMEDIR_XDG 456 456 g_free (mc_config_init_one_config_path (mc_cache_str, EDIT_DIR, mcerror)); 457 457 g_free (mc_config_init_one_config_path (mc_data_str, EDIT_DIR, mcerror)); 458 458 #endif /* MC_HOMEDIR_XDG */ … … 481 481 g_free (old_name); 482 482 } 483 483 484 #if defMC_HOMEDIR_XDG484 #if MC_HOMEDIR_XDG 485 485 *msg = g_strdup_printf (_("Your old settings were migrated from %s\n" 486 486 "to Freedesktop recommended dirs.\n" 487 487 "To get more info, please visit\n" -
tests/lib/mcconfig/user_configs_path.c
a b 37 37 38 38 #define HOME_DIR "/home/testuser" 39 39 40 #if defMC_HOMEDIR_XDG40 #if MC_HOMEDIR_XDG 41 41 #define CONF_MAIN HOME_DIR PATH_SEP_STR ".config" 42 42 #define CONF_DATA HOME_DIR PATH_SEP_STR ".local" PATH_SEP_STR "share" 43 43 #define CONF_CACHE HOME_DIR PATH_SEP_STR ".cache" … … 54 54 setup (void) 55 55 { 56 56 g_setenv ("HOME", HOME_DIR, TRUE); 57 #if defMC_HOMEDIR_XDG57 #if MC_HOMEDIR_XDG 58 58 g_setenv ("XDG_CONFIG_HOME", CONF_MAIN, TRUE); 59 59 g_setenv ("XDG_DATA_HOME", CONF_DATA, TRUE); 60 60 g_setenv ("XDG_CACHE_HOME", CONF_CACHE, TRUE);