diff --git a/cli/main.c b/cli/main.c index c24e167..b0c2300 100644 --- a/cli/main.c +++ b/cli/main.c @@ -21,10 +21,6 @@ #ifndef PKGCONF_LITE #include "renderer-msvc.h" #endif -#ifdef _WIN32 -#include /* for _setmode() */ -#include -#endif #define PKG_CFLAGS_ONLY_I (((uint64_t) 1) << 2) #define PKG_CFLAGS_ONLY_OTHER (((uint64_t) 1) << 3) diff --git a/libpkgconf/libpkgconf.h b/libpkgconf/libpkgconf.h index d8f85ce..b629cec 100644 --- a/libpkgconf/libpkgconf.h +++ b/libpkgconf/libpkgconf.h @@ -31,23 +31,6 @@ extern "C" { #endif -/* pkg-config uses ';' on win32 as ':' is part of path */ -#ifdef _WIN32 -#define PKG_CONFIG_PATH_SEP_S ";" -#else -#define PKG_CONFIG_PATH_SEP_S ":" -#endif - -#ifdef _WIN32 -#define PKG_DIR_SEP_S '\\' -#else -#define PKG_DIR_SEP_S '/' -#endif - -#ifdef _WIN32 -#define realpath(N,R) _fullpath((R),(N),_MAX_PATH) -#endif - #define PKGCONF_BUFSIZE (65535) typedef enum { diff --git a/libpkgconf/path.c b/libpkgconf/path.c index dda77f5..787d11a 100644 --- a/libpkgconf/path.c +++ b/libpkgconf/path.c @@ -22,10 +22,6 @@ # define PKGCONF_CACHE_INODES #endif -#ifdef _WIN32 -# define PKG_CONFIG_REG_KEY "Software\\pkgconfig\\PKG_CONFIG_PATH" -#endif - static bool #ifdef PKGCONF_CACHE_INODES path_list_contains_entry(const char *text, pkgconf_list_t *dirlist, struct stat *st) @@ -410,6 +406,7 @@ pkgconf_path_relocate(char *buf, size_t buflen) } #ifdef _WIN32 +#define PKG_CONFIG_REG_KEY "Software\\pkgconfig\\PKG_CONFIG_PATH" /* * !doc * diff --git a/libpkgconf/personality.c b/libpkgconf/personality.c index 4c392af..7ba2993 100644 --- a/libpkgconf/personality.c +++ b/libpkgconf/personality.c @@ -24,10 +24,6 @@ * ========================= */ -#ifdef _WIN32 -# define strcasecmp _stricmp -#endif - /* * Increment each time the default personality is inited, decrement each time * it's deinited. Whenever it is 0, then the deinit frees the personality. In diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index 72bb389..f2fd85c 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -17,15 +17,6 @@ #include #include -#ifndef _WIN32 -#include // open -#include // basename/dirname -#include // lstat, S_ISLNK -#include // close, readlinkat - -#include -#endif - /* * !doc * @@ -36,13 +27,6 @@ * routines. */ -#ifdef _WIN32 -# undef PKG_DEFAULT_PATH -# define PKG_DEFAULT_PATH "../lib/pkgconfig;../share/pkgconfig" -# define strncasecmp _strnicmp -# define strcasecmp _stricmp -#endif - #define PKG_CONFIG_EXT ".pc" static unsigned int diff --git a/libpkgconf/stdinc.h b/libpkgconf/stdinc.h index 31284ed..1cf7396 100644 --- a/libpkgconf/stdinc.h +++ b/libpkgconf/stdinc.h @@ -31,6 +31,8 @@ # define WIN32_LEAN_AND_MEAN # include # include +# include /* for _setmode() */ +# include # define PATH_DEV_NULL "nul" # ifdef _WIN64 # ifndef __MINGW32__ @@ -52,9 +54,14 @@ # ifndef __MINGW32__ # include "win-dirent.h" # else -# include +# include # endif # define PKGCONF_ITEM_SIZE (_MAX_PATH + 1024) +# define PKG_CONFIG_PATH_SEP_S ";" +# define PKG_DIR_SEP_S '\\' +# define strcasecmp _stricmp +# define strncasecmp _strnicmp +# define realpath(N,R) _fullpath((R),(N),_MAX_PATH) #else # define PATH_DEV_NULL "/dev/null" # define SIZE_FMT_SPECIFIER "%zu" @@ -65,11 +72,18 @@ # include # include # include +# include // open +# include // basename/dirname +# include // lstat, S_ISLNK +# include // close, readlinkat +# include # ifdef PATH_MAX # define PKGCONF_ITEM_SIZE (PATH_MAX + 1024) # else # define PKGCONF_ITEM_SIZE (4096 + 1024) # endif +# define PKG_CONFIG_PATH_SEP_S ":" +# define PKG_DIR_SEP_S '/' #endif #endif