Another attempted Cygwin fix

This commit is contained in:
Evan Miller 2020-08-05 09:22:26 -04:00
parent 7dcb42eae3
commit f1af742ecf
2 changed files with 7 additions and 2 deletions

View File

@ -96,7 +96,7 @@ typedef struct GOptionContext {
#define g_free free
#define g_realloc realloc
#if defined _WIN32 || defined __CYGWIN__
#if defined _WIN32
#define g_strdup _strdup
#else
#define g_strdup strdup

View File

@ -83,7 +83,7 @@ char *g_strconcat(const char *first, ...) {
return ret;
}
#if defined _WIN32 || defined __CYGWIN__
#if defined _WIN32
int vasprintf(char **ret, const char *format, va_list ap) {
int len;
int retval;
@ -106,7 +106,12 @@ char *g_strdup_printf(const char *format, ...) {
va_list argp;
va_start(argp, format);
#ifdef ___CYGWIN__
size_t len = 0;
vasnprintf(&ret, &len, format, argp);
#else
vasprintf(&ret, format, argp);
#endif
va_end(argp);
return ret;