diff options
Diffstat (limited to 'volk')
-rw-r--r-- | volk/gen/make_each_machine_c.py | 4 | ||||
-rw-r--r-- | volk/include/volk/volk_32f_s32f_convert_16i_a.h | 4 | ||||
-rw-r--r-- | volk/lib/volk_prefs.c | 10 |
3 files changed, 13 insertions, 5 deletions
diff --git a/volk/gen/make_each_machine_c.py b/volk/gen/make_each_machine_c.py index 44e2ef3f2..a3f6203ba 100644 --- a/volk/gen/make_each_machine_c.py +++ b/volk/gen/make_each_machine_c.py @@ -65,6 +65,10 @@ def make_each_machine_c(machine_name, archs, functions, fcountlist, taglist, ali #include "volk_machines.h" #include <volk/volk_config_fixed.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + """ for func in functions: tempstring += "#include <volk/" + func + ".h>\n" diff --git a/volk/include/volk/volk_32f_s32f_convert_16i_a.h b/volk/include/volk/volk_32f_s32f_convert_16i_a.h index c2a07398f..a24959678 100644 --- a/volk/include/volk/volk_32f_s32f_convert_16i_a.h +++ b/volk/include/volk/volk_32f_s32f_convert_16i_a.h @@ -1,10 +1,6 @@ #ifndef INCLUDED_volk_32f_s32f_convert_16i_a_H #define INCLUDED_volk_32f_s32f_convert_16i_a_H -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/lib/volk_prefs.c b/volk/lib/volk_prefs.c index b29d5fd87..7e705bed4 100644 --- a/volk/lib/volk_prefs.c +++ b/volk/lib/volk_prefs.c @@ -9,7 +9,14 @@ void get_config_path(char *path) { const char *suffix = "/.volk/volk_config"; - strcpy(path, getenv("HOME")); + char *home = NULL; + if (home == NULL) home = getenv("HOME"); + if (home == NULL) home = getenv("APPDATA"); + if (home == NULL){ + path = NULL; + return; + } + strcpy(path, home); strcat(path, suffix); } @@ -22,6 +29,7 @@ int load_preferences(struct volk_arch_pref **prefs) { //get the config path get_config_path(path); + if (path == NULL) return n_arch_prefs; //no prefs found config_file = fopen(path, "r"); if(!config_file) return n_arch_prefs; //no prefs found |