From 761ef7ae8bad6d76f0f5e550882c5991fc0f92b1 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Sun, 4 Sep 2011 15:16:30 -0700 Subject: [PATCH] cairo-missing: Fix and cleanup ssize_t type definition The definition of ssize_t is needed in cairo-missing.h and can be dropped from files which include it. --- perf/cairo-analyse-trace.c | 2 -- perf/cairo-perf-report.c | 6 ------ perf/cairo-perf-trace.c | 2 -- util/cairo-missing/cairo-missing.h | 8 ++++++++ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/perf/cairo-analyse-trace.c b/perf/cairo-analyse-trace.c index 962290746..ac2a4e7a7 100644 --- a/perf/cairo-analyse-trace.c +++ b/perf/cairo-analyse-trace.c @@ -55,8 +55,6 @@ #ifdef _MSC_VER #include "dirent-win32.h" -typedef SSIZE_T ssize_t; - static char * basename_no_ext (char *path) { diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c index ffcd90ae2..fcce0e035 100644 --- a/perf/cairo-perf-report.c +++ b/perf/cairo-perf-report.c @@ -44,12 +44,6 @@ #include #endif -/* 'ssize_t' does not exist in the C standard on win32. - * We use 'ptrdiff_t', which is nearly equivalent. */ -#ifdef _MSC_VER -typedef ptrdiff_t ssize_t; -#endif - #ifdef _MSC_VER static long long strtoll (const char *nptr, diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c index 3a9b82275..2cef2b14c 100644 --- a/perf/cairo-perf-trace.c +++ b/perf/cairo-perf-trace.c @@ -56,8 +56,6 @@ #ifdef _MSC_VER #include "dirent-win32.h" -typedef SSIZE_T ssize_t; - static char * basename_no_ext (char *path) { diff --git a/util/cairo-missing/cairo-missing.h b/util/cairo-missing/cairo-missing.h index 13977567d..ccb85fa46 100644 --- a/util/cairo-missing/cairo-missing.h +++ b/util/cairo-missing/cairo-missing.h @@ -35,6 +35,14 @@ #include #include +#include + +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include + +typedef SSIZE_T ssize_t; +#endif #ifndef HAVE_GETLINE cairo_private ssize_t