From 353ba1eafe991aa96ae664d36665c1e0e5421daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 2 May 2012 11:24:58 +0200 Subject: [PATCH] Use ';' as path separator on win32. This is what pkg-config does, and it is necessary because ':' is part of path specification on win32. --- pkg.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg.c b/pkg.c index fe73525..c190d66 100644 --- a/pkg.c +++ b/pkg.c @@ -27,6 +27,15 @@ #define PKG_CONFIG_EXT ".pc" #define PKG_CONFIG_PATH_SZ (65535) +#ifdef _WIN32 +/* pkg-config uses ';' on win32 as ':' is part of path */ +#define PKG_CONFIG_PATH_SEP_S ";" +#define PKG_CONFIG_PATH_SEP ';' +#else +#define PKG_CONFIG_PATH_SEP_S ":" +#define PKG_CONFIG_PATH_SEP ':' +#endif + static inline const char * pkg_get_pkgconfig_path(void) { @@ -42,7 +51,7 @@ pkg_get_pkgconfig_path(void) env_path = getenv("PKG_CONFIG_PATH"); if (env_path != NULL) { - strlcat(path, ":", sizeof path); + strlcat(path, PKG_CONFIG_PATH_SEP_S, sizeof path); strlcat(path, env_path, sizeof path); } @@ -63,7 +72,7 @@ pkg_find(const char *name) env_path = pkg_get_pkgconfig_path(); while (env_path[count] != '\0') { - if (env_path[count] && env_path[count] != ':') + if (env_path[count] && env_path[count] != PKG_CONFIG_PATH_SEP) { path[pcount] = env_path[count]; pcount++;