Use __mingw_asprintf if asprintf is not available.

This commit is contained in:
Klaas Freitag 2013-04-22 13:50:59 +02:00
parent 66d8f8b0db
commit 072edefc7b
3 changed files with 9 additions and 0 deletions

View file

@ -58,6 +58,9 @@ check_function_exists(strerror_r HAVE_STRERROR_R)
check_function_exists(utimes HAVE_UTIMES)
check_function_exists(lstat HAVE_LSTAT)
check_function_exists(asprintf HAVE_ASPRINTF)
if (WIN32)
check_function_exists(__mingw_asprintf HAVE___MINGW_ASPRINTF)
endif(WIN32)
if (UNIX AND HAVE_ASPRINTF)
add_definitions(-D_GNU_SOURCE)
endif (UNIX AND HAVE_ASPRINTF)

View file

@ -22,3 +22,5 @@
#cmakedefine HAVE_FNMATCH 1
#cmakedefine NEON_WITH_LFS 1
#cmakedefine HAVE___MINGW_ASPRINTF 1

View file

@ -72,6 +72,10 @@ typedef struct stat csync_stat_t;
#define O_NOATIME 0
#endif
#if !defined(HAVE_ASPRINTF) && defined(HAVE___MINGW_ASPRINTF)
#define asprintf __mingw_asprintf
#endif
/* tchar definitions for clean win32 filenames */
#define _UNICODE