mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 10:30:24 +01:00
test: Fix compilation on win32
The Microsoft C Compiler does not accept empty-initialized arrays: cairo-boilerplate-win32-printing.c(373) : error C2059: syntax error : '}' cairo-boilerplate-win32-printing.c(374) : warning C4034: sizeof returns 0
This commit is contained in:
parent
0cbe3d1020
commit
5cb18fcec7
5 changed files with 34 additions and 9 deletions
|
|
@ -238,10 +238,8 @@ _cairo_boilerplate_pdf_force_fallbacks (cairo_surface_t *abstract_surface,
|
|||
x_pixels_per_inch,
|
||||
y_pixels_per_inch);
|
||||
}
|
||||
#endif
|
||||
|
||||
static const cairo_boilerplate_target_t targets[] = {
|
||||
#if CAIRO_CAN_TEST_PDF_SURFACE
|
||||
{
|
||||
"pdf", "pdf", ".pdf", NULL,
|
||||
CAIRO_SURFACE_TYPE_PDF,
|
||||
|
|
@ -269,6 +267,11 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_pdf_cleanup,
|
||||
NULL, NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
CAIRO_BOILERPLATE (pdf, targets)
|
||||
|
||||
#else
|
||||
|
||||
CAIRO_NO_BOILERPLATE (pdf)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ void _register_##name__ (void) { \
|
|||
sizeof (targets__) / sizeof (targets__[0])); \
|
||||
}
|
||||
|
||||
#define CAIRO_NO_BOILERPLATE(name__) \
|
||||
void _register_##name__ (void); \
|
||||
void _register_##name__ (void) { }
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#endif /* _CAIRO_BOILERPLATE_PRIVATE_H_ */
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include "cairo-boilerplate-private.h"
|
||||
|
||||
#if CAIRO_CAN_TEST_PS_SURFACE
|
||||
|
||||
#include <cairo-ps.h>
|
||||
|
||||
#include <cairo-ps-surface-private.h>
|
||||
|
|
@ -302,7 +304,6 @@ _cairo_boilerplate_ps_force_fallbacks (cairo_surface_t *abstract_surface,
|
|||
}
|
||||
|
||||
static const cairo_boilerplate_target_t targets[] = {
|
||||
#if CAIRO_CAN_TEST_PS_SURFACE
|
||||
{
|
||||
"ps2", "ps", ".ps", NULL,
|
||||
CAIRO_SURFACE_TYPE_PS,
|
||||
|
|
@ -357,6 +358,11 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_ps_cleanup,
|
||||
NULL, NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
CAIRO_BOILERPLATE (ps, targets)
|
||||
|
||||
#else
|
||||
|
||||
CAIRO_NO_BOILERPLATE (ps)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include "cairo-boilerplate-private.h"
|
||||
|
||||
#if CAIRO_CAN_TEST_SVG_SURFACE
|
||||
|
||||
#include <cairo-svg.h>
|
||||
#include <cairo-svg-surface-private.h>
|
||||
#include <cairo-paginated-surface-private.h>
|
||||
|
|
@ -274,7 +276,6 @@ _cairo_boilerplate_svg_force_fallbacks (cairo_surface_t *abstract_surface,
|
|||
}
|
||||
|
||||
static const cairo_boilerplate_target_t targets[] = {
|
||||
#if CAIRO_CAN_TEST_SVG_SURFACE
|
||||
/* It seems we should be able to round-trip SVG content perfectly
|
||||
* through librsvg and cairo, but for some mysterious reason, some
|
||||
* systems get an error of 1 for some pixels on some of the text
|
||||
|
|
@ -332,6 +333,11 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_svg_cleanup,
|
||||
NULL, NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
CAIRO_BOILERPLATE (svg, targets)
|
||||
|
||||
#else
|
||||
|
||||
CAIRO_NO_BOILERPLATE (svg)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
#include "cairo-boilerplate-private.h"
|
||||
|
||||
#if CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE
|
||||
|
||||
#include <cairo-win32.h>
|
||||
#include <cairo-win32-private.h>
|
||||
#include <cairo-paginated-surface-private.h>
|
||||
|
|
@ -343,7 +345,6 @@ _cairo_boilerplate_win32_printing_cleanup (void *closure)
|
|||
}
|
||||
|
||||
static const cairo_boilerplate_target_t targets[] = {
|
||||
#if CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE
|
||||
{
|
||||
"win32-printing", "win32", ".ps", NULL,
|
||||
CAIRO_SURFACE_TYPE_WIN32_PRINTING,
|
||||
|
|
@ -369,6 +370,11 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_win32_printing_cleanup,
|
||||
NULL, NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
CAIRO_BOILERPLATE (win32_printing, targets)
|
||||
|
||||
#else
|
||||
|
||||
CAIRO_NO_BOILERPLATE (win32_printing)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue