mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 05:50:10 +01:00
Fix build on Windows with recent versions of MSVC
- vsnprintf and snprintf are available since vs2015 - define ISREG if not provided - guard unistd.h include with HAVE_UNISTD_H - isnan() is available after vs2010
This commit is contained in:
parent
91b5761acd
commit
a75f8df957
3 changed files with 12 additions and 2 deletions
|
|
@ -201,10 +201,12 @@
|
|||
#define hypot _hypot
|
||||
#define pclose _pclose
|
||||
#define popen _popen
|
||||
#define snprintf _snprintf
|
||||
#define strdup _strdup
|
||||
#define unlink _unlink
|
||||
#define vsnprintf _vsnprintf
|
||||
#if _MSC_VER < 1900
|
||||
#define vsnprintf _vsnprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <cairo-ft.h>
|
||||
#include <fontconfig/fontconfig.h>
|
||||
|
|
@ -73,6 +75,10 @@ check_font_extents (const cairo_test_context_t *ctx, cairo_t *cr, const char *co
|
|||
return CAIRO_TEST_SUCCESS;
|
||||
}
|
||||
|
||||
#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
|
||||
static cairo_test_status_t
|
||||
draw (cairo_t *cr, int width, int height)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ typedef unsigned __int64 uint64_t;
|
|||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <float.h>
|
||||
#if _MSC_VER <= 1600
|
||||
#define isnan(x) _isnan(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue