Fix some mingw warnings and correct the value of R_OK

This commit is contained in:
Adrian Johnson 2021-08-07 15:44:21 +09:30
parent 1091134258
commit 76331f654e
3 changed files with 15 additions and 3 deletions

View file

@ -195,7 +195,9 @@
#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
#define access _access
#define R_OK 0
#ifndef R_OK
#define R_OK 4
#endif
#define fdopen _fdopen
#define hypot _hypot
#define pclose _pclose

View file

@ -102,7 +102,11 @@
#endif
#ifndef HAVE_CTIME_R
#define ctime_r(T, BUF) ctime (T)
static char *ctime_r(const time_t *timep, char *buf)
{
(void)buf;
return ctime(timep);
}
#endif
/**

View file

@ -129,6 +129,8 @@ _create_dc_and_bitmap (cairo_win32_display_surface_t *surface,
case CAIRO_FORMAT_INVALID:
case CAIRO_FORMAT_RGB16_565:
case CAIRO_FORMAT_RGB30:
case CAIRO_FORMAT_RGB96F:
case CAIRO_FORMAT_RGBA128F:
return _cairo_error (CAIRO_STATUS_INVALID_FORMAT);
case CAIRO_FORMAT_ARGB32:
case CAIRO_FORMAT_RGB24:
@ -164,7 +166,9 @@ _create_dc_and_bitmap (cairo_win32_display_surface_t *surface,
case CAIRO_FORMAT_INVALID:
case CAIRO_FORMAT_RGB16_565:
case CAIRO_FORMAT_RGB30:
ASSERT_NOT_REACHED;
case CAIRO_FORMAT_RGB96F:
case CAIRO_FORMAT_RGBA128F:
ASSERT_NOT_REACHED;
/* We can't create real RGB24 bitmaps because something seems to
* break if we do, especially if we don't set up an image
* fallback. It could be a bug with using a 24bpp pixman image
@ -242,6 +246,8 @@ _create_dc_and_bitmap (cairo_win32_display_surface_t *surface,
case CAIRO_FORMAT_INVALID:
case CAIRO_FORMAT_RGB16_565:
case CAIRO_FORMAT_RGB30:
case CAIRO_FORMAT_RGB96F:
case CAIRO_FORMAT_RGBA128F:
ASSERT_NOT_REACHED;
case CAIRO_FORMAT_ARGB32:
case CAIRO_FORMAT_RGB24: