diff options
| author | Johannes van Waveren <janpaul.vanwaveren@oculus.com> | 2015-10-28 11:45:00 -0500 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-10-28 15:39:36 -0600 |
| commit | ed993ac4d8c5475d9c0e4f062e784c849990148c (patch) | |
| tree | 39a70721763fe86579782efa7d7fcefb10c48260 /loader | |
| parent | 515b7aed05ca136bdc86be7e4f3c6aab7e60dff8 (diff) | |
| download | usermoji-ed993ac4d8c5475d9c0e4f062e784c849990148c.tar.xz | |
use conditional compilation based on _WIN32 instead of WIN32 and __linux__
Diffstat (limited to 'loader')
| -rw-r--r-- | loader/loader.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/loader/loader.c b/loader/loader.c index 44c7d667..e3f22a27 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -35,11 +35,11 @@ #include <string.h> #include <sys/types.h> -#if defined(WIN32) +#if defined(_WIN32) #include "dirent_on_windows.h" -#else // WIN32 +#else // _WIN32 #include <dirent.h> -#endif // WIN32 +#endif // _WIN32 #include "vk_loader_platform.h" #include "loader.h" #include "gpa_helper.h" @@ -1626,7 +1626,7 @@ static void loader_get_manifest_files(const struct loader_instance *inst, out_files->filename_list = NULL; if (env_override != NULL && (override = getenv(env_override))) { -#if defined(__linux__) +#if !defined(_WIN32) if (geteuid() != getuid()) { /* Don't allow setuid apps to use the env var: */ override = NULL; @@ -1641,10 +1641,10 @@ static void loader_get_manifest_files(const struct loader_instance *inst, return; } -#if defined(__linux__) - list_is_dirs = (override == NULL || is_layer) ? true : false; -#else //WIN32 +#if defined(_WIN32) list_is_dirs = (is_layer && override != NULL) ? true : false; +#else + list_is_dirs = (override == NULL || is_layer) ? true : false; #endif // Make a copy of the input we are using so it is not modified // Also handle getting the location(s) from registry on Windows @@ -1655,7 +1655,7 @@ static void loader_get_manifest_files(const struct loader_instance *inst, return; } strcpy(loc, location); -#if defined (_WIN32) +#if defined(_WIN32) loc = loader_get_registry_files(inst, loc); if (loc == NULL) { loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Registry lookup failed can't get manifest files"); @@ -1691,7 +1691,9 @@ static void loader_get_manifest_files(const struct loader_instance *inst, } } else { -#if defined(__linux__) +#if defined(_WIN32) + name = file; +#else // only Linux has relative paths char *dir; // make a copy of location so it isn't modified @@ -1705,8 +1707,6 @@ static void loader_get_manifest_files(const struct loader_instance *inst, loader_get_fullpath(file, dir, sizeof(full_path), full_path); name = full_path; -#else // WIN32 - name = file; #endif } while (name) { @@ -1852,11 +1852,11 @@ void loader_icd_scan( strcpy(def_path, DEFAULT_VK_DRIVERS_PATH); path_len = strlen(DEFAULT_VK_DRIVERS_PATH) + strlen(library_path) + 2; fullpath = loader_stack_alloc(path_len); -#if defined(__linux__) +#if defined(_WIN32) + strncpy(fullpath, library_path, path_len); + fullpath[path_len - 1] = '\0'; +#else loader_get_fullpath(library_path, def_path, path_len, fullpath); -#else // WIN32 - strncpy(fullpath, library_path, sizeof (fullpath)); - fullpath[sizeof (fullpath) - 1] = '\0'; #endif } else { // a relative or absolute path |
