Skip to content

Commit

Permalink
test: Fix any2ppm on MSVC
Browse files Browse the repository at this point in the history
C99 initialization is not allowed.

Error macros are used even in the non-daemon version, hence errno.h
should always be included.

Fixes:

any2ppm.c(107) : error C2065: 'EINTR' : undeclared identifier
any2ppm.c(107) : error C2051: case expression not constant
any2ppm.c(108) : error C2065: 'EAGAIN' : undeclared identifier
any2ppm.c(108) : error C2051: case expression not constant
any2ppm.c(271) : error C2059: syntax error : '.'
  • Loading branch information
Andrea Canciani committed Feb 16, 2012
1 parent b2d978a commit 80c46d4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/any2ppm.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@
#include <libspectre/spectre.h>
#endif

#include <errno.h>

#if HAVE_UNISTD_H && HAVE_FCNTL_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_POLL_H && HAVE_SYS_UN_H
#include <fcntl.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/poll.h>
#include <sys/un.h>
#include <errno.h>

#define SOCKET_PATH "./.any2ppm"
#define TIMEOUT 60000 /* 60 seconds */
Expand Down Expand Up @@ -268,8 +269,13 @@ _cairo_script_render_page (const char *filename,
cairo_surface_t *surface = NULL;
cairo_status_t status;
const cairo_script_interpreter_hooks_t hooks = {
.closure = &surface,
.surface_create = _create_image,
&surface,
_create_image,
NULL, /* surface_destroy */
NULL, /* context_create */
NULL, /* context_destroy */
NULL, /* show_page */
NULL /* copy_page */
};

csi = cairo_script_interpreter_create ();
Expand Down

0 comments on commit 80c46d4

Please sign in to comment.