AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
-AC_CHECK_FUNCS([gettimeofday nl_langinfo strdup])
+AC_CHECK_FUNCS([gettimeofday nl_langinfo strdup _vscprintf])
AC_CHECK_FUNC(getopt_long)
AM_CONDITIONAL([FDK_NO_GETOPT_LONG],[test "$ac_cv_func_getopt_long" != "yes"])
AC_SEARCH_LIBS([aacEncOpen],[fdk-aac],[],[],[])
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
+#include <assert.h>
#include <io.h>
#include <fcntl.h>
#include <sys/timeb.h>
return _strdup(s);
}
+#if defined(__MINGW32__) && !defined(HAVE__VSCPRINTF)
+int _vscprintf(const char *fmt, va_list ap)
+{
+ static int (*fp_vscprintf)(const char *, va_list) = 0;
+ if (!fp_vscprintf) {
+ HANDLE h = GetModuleHandleA("msvcrt.dll");
+ FARPROC fp = GetProcAddress(h, "_vscprintf");
+ InterlockedCompareExchangePointer(&fp_vscprintf, fp, 0);
+ }
+ assert(fp_vscprintf);
+ return fp_vscprintf(fmt, ap);
+}
+#endif
+
int aacenc_fprintf(FILE *fp, const char *fmt, ...)
{
va_list ap;