summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2021-08-07 15:44:21 +0930
committerAdrian Johnson <ajohnson@redneon.com>2021-08-07 15:44:21 +0930
commit76331f654eef10d3feed2fc335d037416f5b609f (patch)
tree212d2ecbded325904bb7346d61dcad405148d04c
parent10911342584fce363579ecd67faccd169150b7d7 (diff)
Fix some mingw warnings and correct the value of R_OK
-rw-r--r--src/cairo-compiler-private.h4
-rw-r--r--src/cairo-ps-surface.c6
-rw-r--r--src/win32/cairo-win32-display-surface.c8
3 files changed, 15 insertions, 3 deletions
diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h
index e95658105..ffad1cf15 100644
--- a/src/cairo-compiler-private.h
+++ b/src/cairo-compiler-private.h
@@ -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
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 0e7b77059..c61c2246d 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -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
/**
diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
index 304d34aea..93d33b38b 100644
--- a/src/win32/cairo-win32-display-surface.c
+++ b/src/win32/cairo-win32-display-surface.c
@@ -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: