Another attempt to fix building using MINGW. Affects #55

This commit is contained in:
Lior Halphon 2018-03-29 21:46:14 +03:00
parent c7ca786e77
commit b757b4c590
2 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,9 @@
#pragma once
#include_next <math.h>
#ifndef __MINGW32__
/* "Old" (Pre-2015) Windows headers/libc don't have round. */
static inline double round(double f)
{
return f >= 0? (int)(f + 0.5) : (int)(f - 0.5);
}
#endif

View File

@ -2,6 +2,7 @@
#include_next <stdio.h>
#include <stdlib.h>
#ifndef __MINGW32__
#ifndef __LIBRETRO__
static inline int vasprintf(char **str, const char *fmt, va_list args)
{
@ -16,6 +17,7 @@ static inline int vasprintf(char **str, const char *fmt, va_list args)
return ret;
}
#endif
#endif
/* This code is public domain -- Will Hartung 4/9/09 */
static inline size_t getline(char **lineptr, size_t *n, FILE *stream) {