diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-18 16:58:40 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 22:30:43 +0000 |
commit | c50c8b90c0033686b465e6766fba4772c1d698c6 (patch) | |
tree | 522b36726b6e97e44cff2fc40afdcfcde110632b /src | |
parent | 558f9501700ba569f04f345f7c64d16b1870e37c (diff) |
Move _cairo_error() to a standalone header
A pending commit will want to include some utility code from cairo and
so we need to extricate the error handling from the PLT symbol hiding.
Diffstat (limited to 'src')
96 files changed, 170 insertions, 17 deletions
diff --git a/src/Makefile.sources b/src/Makefile.sources index 71d0abd0..6dbe3fb0 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -59,6 +59,7 @@ cairo_private = \ cairo-clip-private.h \ cairo-combsort-private.h \ cairo-compiler-private.h \ + cairo-error-private.h \ cairo-fixed-private.h \ cairo-fixed-type-private.h \ cairo-freelist-private.h \ diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c index 0ba667d4..019dc303 100644 --- a/src/cairo-analysis-surface.c +++ b/src/cairo-analysis-surface.c @@ -37,6 +37,7 @@ #include "cairoint.h" #include "cairo-analysis-surface-private.h" +#include "cairo-error-private.h" #include "cairo-paginated-private.h" #include "cairo-recording-surface-private.h" #include "cairo-region-private.h" diff --git a/src/cairo-array.c b/src/cairo-array.c index fcd1246d..bb6450a1 100644 --- a/src/cairo-array.c +++ b/src/cairo-array.c @@ -36,6 +36,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" /** * _cairo_array_init: diff --git a/src/cairo-base64-stream.c b/src/cairo-base64-stream.c index 2b211ff0..b663cfe7 100644 --- a/src/cairo-base64-stream.c +++ b/src/cairo-base64-stream.c @@ -37,6 +37,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-output-stream-private.h" typedef struct _cairo_base64_stream { diff --git a/src/cairo-base85-stream.c b/src/cairo-base85-stream.c index 791e8013..6aefb05b 100644 --- a/src/cairo-base85-stream.c +++ b/src/cairo-base85-stream.c @@ -35,6 +35,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-output-stream-private.h" typedef struct _cairo_base85_stream { diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c index 9887b824..4a65655f 100644 --- a/src/cairo-bentley-ottmann-rectangular.c +++ b/src/cairo-bentley-ottmann-rectangular.c @@ -38,6 +38,7 @@ /* Provide definitions for standalone compilation */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-combsort-private.h" #include "cairo-list-private.h" diff --git a/src/cairo-bentley-ottmann-rectilinear.c b/src/cairo-bentley-ottmann-rectilinear.c index c7e738b6..c0b4fcce 100644 --- a/src/cairo-bentley-ottmann-rectilinear.c +++ b/src/cairo-bentley-ottmann-rectilinear.c @@ -39,6 +39,7 @@ #include "cairoint.h" #include "cairo-combsort-private.h" +#include "cairo-error-private.h" typedef struct _cairo_bo_edge cairo_bo_edge_t; typedef struct _cairo_bo_trap cairo_bo_trap_t; diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c index cb508f51..81cca79b 100644 --- a/src/cairo-bentley-ottmann.c +++ b/src/cairo-bentley-ottmann.c @@ -38,6 +38,7 @@ /* Provide definitions for standalone compilation */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-freelist-private.h" #include "cairo-combsort-private.h" diff --git a/src/cairo-beos-surface.cpp b/src/cairo-beos-surface.cpp index 6fbdc470..68d08147 100644 --- a/src/cairo-beos-surface.cpp +++ b/src/cairo-beos-surface.cpp @@ -40,6 +40,8 @@ #include "cairo-beos.h" +#include "cairo-error-private.h" + #include <new> #include <Bitmap.h> diff --git a/src/cairo-cache.c b/src/cairo-cache.c index 025dd9ff..1bc30899 100644 --- a/src/cairo-cache.c +++ b/src/cairo-cache.c @@ -37,6 +37,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" static void _cairo_cache_shrink_to_accommodate (cairo_cache_t *cache, diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c index 1f4cb922..1ccc53c2 100644 --- a/src/cairo-cff-subset.c +++ b/src/cairo-cff-subset.c @@ -41,6 +41,7 @@ #define _BSD_SOURCE /* for snprintf(), strdup() */ #include "cairoint.h" +#include "cairo-error-private.h" #if CAIRO_HAS_FONT_SUBSET diff --git a/src/cairo-clip.c b/src/cairo-clip.c index 8d66a5ff..2a50385f 100644 --- a/src/cairo-clip.c +++ b/src/cairo-clip.c @@ -41,6 +41,7 @@ #include "cairoint.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-path-fixed-private.h" #include "cairo-region-private.h" diff --git a/src/cairo-deflate-stream.c b/src/cairo-deflate-stream.c index 863189f4..f4c41ca5 100644 --- a/src/cairo-deflate-stream.c +++ b/src/cairo-deflate-stream.c @@ -35,6 +35,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-output-stream-private.h" #include <zlib.h> diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c index afad2705..0d39e4b5 100644 --- a/src/cairo-directfb-surface.c +++ b/src/cairo-directfb-surface.c @@ -39,6 +39,7 @@ #include "cairo-directfb.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include <pixman.h> diff --git a/src/cairo-eagle-context.c b/src/cairo-eagle-context.c index 23766a94..72efc2e0 100644 --- a/src/cairo-eagle-context.c +++ b/src/cairo-eagle-context.c @@ -40,6 +40,7 @@ #include "cairo-gl-private.h" +#include "cairo-error-private.h" #include <i915_drm.h> /* XXX dummy surface for glewInit() */ #include <sys/ioctl.h> diff --git a/src/cairo-error-private.h b/src/cairo-error-private.h new file mode 100644 index 00000000..6bcda752 --- /dev/null +++ b/src/cairo-error-private.h @@ -0,0 +1,60 @@ +/* cairo - a vector graphics library with display and print output + * + * Copyright © 2002 University of Southern California + * Copyright © 2005 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it either under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation + * (the "LGPL") or, at your option, under the terms of the Mozilla + * Public License Version 1.1 (the "MPL"). If you do not alter this + * notice, a recipient may use your version of this file under either + * the MPL or the LGPL. + * + * You should have received a copy of the LGPL along with this library + * in the file COPYING-LGPL-2.1; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the MPL along with this library + * in the file COPYING-MPL-1.1 + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY + * OF ANY KIND, either express or implied. See the LGPL or the MPL for + * the specific language governing rights and limitations. + * + * The Original Code is the cairo graphics library. + * + * The Initial Developer of the Original Code is University of Southern + * California. + * + * Contributor(s): + * Carl D. Worth <cworth@cworth.org> + */ + +#ifndef _CAIRO_ERROR_PRIVATE_H_ +#define _CAIRO_ERROR_PRIVATE_H_ + +#include "cairo.h" +#include "cairo-compiler-private.h" + +CAIRO_BEGIN_DECLS + +#define _cairo_status_is_error(status) \ + (status != CAIRO_STATUS_SUCCESS && status <= CAIRO_STATUS_LAST_STATUS) + +cairo_private cairo_status_t +_cairo_error (cairo_status_t status); + +/* hide compiler warnings when discarding the return value */ +#define _cairo_error_throw(status) do { \ + cairo_status_t status__ = _cairo_error (status); \ + (void) status__; \ +} while (0) + +CAIRO_END_DECLS + +#endif /* _CAIRO_ERROR_PRIVATE_H_ */ diff --git a/src/cairo-font-face-twin.c b/src/cairo-font-face-twin.c index 56ebaeaa..2ce08587 100644 --- a/src/cairo-font-face-twin.c +++ b/src/cairo-font-face-twin.c @@ -35,6 +35,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" #include <math.h> diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c index 6744899b..3e73aac6 100644 --- a/src/cairo-font-face.c +++ b/src/cairo-font-face.c @@ -39,6 +39,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" /* #cairo_font_face_t */ diff --git a/src/cairo-font-options.c b/src/cairo-font-options.c index b2cb230b..9d10075f 100644 --- a/src/cairo-font-options.c +++ b/src/cairo-font-options.c @@ -35,6 +35,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" static const cairo_font_options_t _cairo_font_options_nil = { CAIRO_ANTIALIAS_DEFAULT, diff --git a/src/cairo-freelist.c b/src/cairo-freelist.c index acf31573..a62976e7 100644 --- a/src/cairo-freelist.c +++ b/src/cairo-freelist.c @@ -22,6 +22,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-freelist-private.h" void diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index 447855cc..1c56031a 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -41,6 +41,7 @@ #define _BSD_SOURCE /* for strdup() */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-ft-private.h" #include <float.h> diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c index ecbbd0b3..35546ff0 100644 --- a/src/cairo-gl-glyphs.c +++ b/src/cairo-gl-glyphs.c @@ -33,6 +33,8 @@ #include "cairoint.h" #include "cairo-gl-private.h" + +#include "cairo-error-private.h" #include "cairo-rtree-private.h" #define GLYPH_CACHE_WIDTH 1024 diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c index f06991ee..5eb8e687 100644 --- a/src/cairo-gl-shaders.c +++ b/src/cairo-gl-shaders.c @@ -32,6 +32,7 @@ #include "cairoint.h" #include "cairo-gl-private.h" +#include "cairo-error-private.h" static GLint _cairo_gl_compile_glsl(GLenum type, GLint *shader_out, const char *source) diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index 5335e4b3..4fa07905 100644 --- a/src/cairo-gl-surface.c +++ b/src/cairo-gl-surface.c @@ -37,6 +37,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-gl-private.h" slim_hidden_proto (cairo_gl_context_reference); diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c index 5f97f65e..73bc9959 100644 --- a/src/cairo-glitz-surface.c +++ b/src/cairo-glitz-surface.c @@ -27,6 +27,8 @@ #include "cairoint.h" #include "cairo-glitz.h" #include "cairo-glitz-private.h" + +#include "cairo-error-private.h" #include "cairo-region-private.h" typedef struct _cairo_glitz_surface { diff --git a/src/cairo-glx-context.c b/src/cairo-glx-context.c index b442a1fc..3fd63170 100644 --- a/src/cairo-glx-context.c +++ b/src/cairo-glx-context.c @@ -40,6 +40,8 @@ #include "cairo-gl-private.h" +#include "cairo-error-private.h" + #include <X11/Xutil.h> /* XXX needs hooking into XCloseDisplay() */ diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index 27993926..3fbdb1ef 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -40,6 +40,7 @@ #include "cairoint.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-gstate-private.h" #if _XOPEN_SOURCE >= 600 || defined (_ISOC99_SOURCE) diff --git a/src/cairo-hash.c b/src/cairo-hash.c index 15159d92..86b6277c 100644 --- a/src/cairo-hash.c +++ b/src/cairo-hash.c @@ -37,6 +37,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" /* * An entry can be in one of three states: diff --git a/src/cairo-hull.c b/src/cairo-hull.c index 8a1a31e2..abd8dbf1 100644 --- a/src/cairo-hull.c +++ b/src/cairo-hull.c @@ -36,6 +36,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-slope-private.h" typedef struct cairo_hull { diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index e644aad5..339e4d20 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -38,6 +38,7 @@ #include "cairoint.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-region-private.h" /* Limit on the width / height of an image surface in pixels. This is diff --git a/src/cairo-lzw.c b/src/cairo-lzw.c index a4fdf738..c295f86c 100644 --- a/src/cairo-lzw.c +++ b/src/cairo-lzw.c @@ -35,6 +35,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" typedef struct _lzw_buf { cairo_status_t status; diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c index bf20ee4f..bf97273d 100644 --- a/src/cairo-matrix.c +++ b/src/cairo-matrix.c @@ -37,6 +37,7 @@ #define _GNU_SOURCE #include "cairoint.h" +#include "cairo-error-private.h" #if _XOPEN_SOURCE >= 600 || defined (_ISOC99_SOURCE) #define ISFINITE(x) isfinite (x) diff --git a/src/cairo-misc.c b/src/cairo-misc.c index 56c7d0b5..c0a792eb 100644 --- a/src/cairo-misc.c +++ b/src/cairo-misc.c @@ -39,6 +39,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" COMPILE_TIME_ASSERT (CAIRO_STATUS_LAST_STATUS < CAIRO_INT_STATUS_UNSUPPORTED); COMPILE_TIME_ASSERT (CAIRO_INT_STATUS_LAST_STATUS <= 127); diff --git a/src/cairo-os2-surface.c b/src/cairo-os2-surface.c index 3fda0b4f..d9eaafa6 100644 --- a/src/cairo-os2-surface.c +++ b/src/cairo-os2-surface.c @@ -38,6 +38,7 @@ #include "cairoint.h" #include "cairo-os2-private.h" +#include "cairo-error-private.h" #if CAIRO_HAS_FC_FONT #include <fontconfig/fontconfig.h> diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c index 20f676c9..ceaa5061 100644 --- a/src/cairo-output-stream.c +++ b/src/cairo-output-stream.c @@ -37,6 +37,7 @@ #include "cairoint.h" #include "cairo-output-stream-private.h" +#include "cairo-error-private.h" #include "cairo-compiler-private.h" #include <stdio.h> diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index dff5e831..b5f619b0 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -48,6 +48,7 @@ #include "cairo-paginated-surface-private.h" #include "cairo-recording-surface-private.h" #include "cairo-analysis-surface-private.h" +#include "cairo-error-private.h" static const cairo_surface_backend_t cairo_paginated_surface_backend; diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c index 037b8078..e3c91295 100644 --- a/src/cairo-path-fill.c +++ b/src/cairo-path-fill.c @@ -35,6 +35,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-path-fixed-private.h" #include "cairo-region-private.h" diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index 34de6a37..958c85c0 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -38,6 +38,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-path-fixed-private.h" #include "cairo-slope-private.h" diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 6e1986a9..9c79d77d 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -39,6 +39,7 @@ #define _BSD_SOURCE /* for hypot() */ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-path-fixed-private.h" #include "cairo-slope-private.h" diff --git a/src/cairo-path.c b/src/cairo-path.c index 05445054..29c968ef 100644 --- a/src/cairo-path.c +++ b/src/cairo-path.c @@ -37,6 +37,7 @@ #include "cairoint.h" #include "cairo-private.h" +#include "cairo-error-private.h" #include "cairo-path-private.h" #include "cairo-path-fixed-private.h" diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 598d2042..f5e5b9d1 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -29,6 +29,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" static const cairo_solid_pattern_t _cairo_pattern_nil = { { CAIRO_PATTERN_TYPE_SOLID, /* type */ diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c index 7b88092e..e4a07236 100644 --- a/src/cairo-pdf-operators.c +++ b/src/cairo-pdf-operators.c @@ -43,6 +43,7 @@ #if CAIRO_HAS_PDF_OPERATORS +#include "cairo-error-private.h" #include "cairo-pdf-operators-private.h" #include "cairo-path-fixed-private.h" #include "cairo-output-stream-private.h" diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index a1be10a0..515e9f6b 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -45,6 +45,7 @@ #include "cairo-pdf-surface-private.h" #include "cairo-pdf-operators-private.h" #include "cairo-analysis-surface-private.h" +#include "cairo-error-private.h" #include "cairo-image-info-private.h" #include "cairo-recording-surface-private.h" #include "cairo-output-stream-private.h" diff --git a/src/cairo-pen.c b/src/cairo-pen.c index cfb67cae..01b34658 100644 --- a/src/cairo-pen.c +++ b/src/cairo-pen.c @@ -38,6 +38,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-slope-private.h" static int diff --git a/src/cairo-png.c b/src/cairo-png.c index d4f04760..f89e03fc 100644 --- a/src/cairo-png.c +++ b/src/cairo-png.c @@ -37,6 +37,8 @@ */ #include "cairoint.h" + +#include "cairo-error-private.h" #include "cairo-output-stream-private.h" #include <stdio.h> diff --git a/src/cairo-polygon.c b/src/cairo-polygon.c index 9cb76e55..68c69e89 100644 --- a/src/cairo-polygon.c +++ b/src/cairo-polygon.c @@ -36,6 +36,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-slope-private.h" void diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index fd3c73d5..72dcbd45 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -58,6 +58,7 @@ #include "cairo-ps.h" #include "cairo-ps-surface-private.h" #include "cairo-pdf-operators-private.h" +#include "cairo-error-private.h" #include "cairo-scaled-font-subsets-private.h" #include "cairo-paginated-private.h" #include "cairo-recording-surface-private.h" diff --git a/src/cairo-qt-surface.cpp b/src/cairo-qt-surface.cpp index 29ca0be0..58d59b52 100644 --- a/src/cairo-qt-surface.cpp +++ b/src/cairo-qt-surface.cpp @@ -38,10 +38,12 @@ #define __STDC_LIMIT_MACROS #include "cairoint.h" -#include "cairo-types-private.h" + #include "cairo-clip-private.h" -#include "cairo-surface-clipper-private.h" +#include "cairo-error-private.h" #include "cairo-region-private.h" +#include "cairo-surface-clipper-private.h" +#include "cairo-types-private.h" #include "cairo-qt.h" diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c index a8a9fc51..0ed2a502 100644 --- a/src/cairo-quartz-font.c +++ b/src/cairo-quartz-font.c @@ -41,6 +41,8 @@ #include "cairo-quartz.h" #include "cairo-quartz-private.h" +#include "cairo-error-private.h" + /* CreateWithFontName exists in 10.5, but not in 10.4; CreateWithName isn't public in 10.4 */ static CGFontRef (*CGFontCreateWithFontNamePtr) (CFStringRef) = NULL; static CGFontRef (*CGFontCreateWithNamePtr) (const char *) = NULL; diff --git a/src/cairo-quartz-image-surface.c b/src/cairo-quartz-image-surface.c index 27d8d6d0..6fdb35c2 100644 --- a/src/cairo-quartz-image-surface.c +++ b/src/cairo-quartz-image-surface.c @@ -39,6 +39,8 @@ #include "cairo-quartz-image.h" #include "cairo-quartz-private.h" +#include "cairo-error-private.h" + #define SURFACE_ERROR_NO_MEMORY (_cairo_surface_create_in_error(_cairo_error(CAIRO_STATUS_NO_MEMORY))) #define SURFACE_ERROR_TYPE_MISMATCH (_cairo_surface_create_in_error(_cairo_error(CAIRO_STATUS_SURFACE_TYPE_MISMATCH))) #define SURFACE_ERROR_INVALID_SIZE (_cairo_surface_create_in_error(_cairo_error(CAIRO_STATUS_INVALID_SIZE))) diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c index 9e1cf5fe..78ef3eea 100644 --- a/src/cairo-quartz-surface.c +++ b/src/cairo-quartz-surface.c @@ -38,6 +38,8 @@ #include "cairoint.h" #include "cairo-quartz-private.h" + +#include "cairo-error-private.h" #include "cairo-surface-clipper-private.h" #include <dlfcn.h> diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c index c50b330e..54260e0f 100644 --- a/src/cairo-recording-surface.c +++ b/src/cairo-recording-surface.c @@ -74,8 +74,9 @@ #include "cairoint.h" #include "cairo-analysis-surface-private.h" -#include "cairo-recording-surface-private.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" +#include "cairo-recording-surface-private.h" #include "cairo-surface-wrapper-private.h" typedef enum { diff --git a/src/cairo-region.c b/src/cairo-region.c index 2148fcab..6ccd7351 100644 --- a/src/cairo-region.c +++ b/src/cairo-region.c @@ -38,6 +38,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-region-private.h" /* XXX need to update pixman headers to be const as appropriate */ diff --git a/src/cairo-rtree.c b/src/cairo-rtree.c index d4bdbd4b..80061130 100644 --- a/src/cairo-rtree.c +++ b/src/cairo-rtree.c @@ -36,6 +36,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-rtree-private.h" cairo_rtree_node_t * diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c index 05478295..e911f311 100644 --- a/src/cairo-scaled-font-subsets.c +++ b/src/cairo-scaled-font-subsets.c @@ -42,6 +42,7 @@ #define _BSD_SOURCE /* for snprintf(), strdup() */ #include "cairoint.h" +#include "cairo-error-private.h" #if CAIRO_HAS_FONT_SUBSET diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index e4010e90..91d89171 100644 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -41,6 +41,7 @@ #define _GNU_SOURCE #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-scaled-font-private.h" #if _XOPEN_SOURCE >= 600 || defined (_ISOC99_SOURCE) diff --git a/src/cairo-script-surface.c b/src/cairo-script-surface.c index ec06364b..8b04c8a5 100644 --- a/src/cairo-script-surface.c +++ b/src/cairo-script-surface.c @@ -47,6 +47,7 @@ #include "cairo-script.h" #include "cairo-analysis-surface-private.h" +#include "cairo-error-private.h" #include "cairo-ft-private.h" #include "cairo-list-private.h" #include "cairo-recording-surface-private.h" diff --git a/src/cairo-stroke-style.c b/src/cairo-stroke-style.c index 36afeeb0..eac69dbb 100644 --- a/src/cairo-stroke-style.c +++ b/src/cairo-stroke-style.c @@ -34,6 +34,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" void _cairo_stroke_style_init (cairo_stroke_style_t *style) diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c index c5ef2740..c9f9a01c 100644 --- a/src/cairo-surface-fallback.c +++ b/src/cairo-surface-fallback.c @@ -42,6 +42,7 @@ #include "cairo-surface-fallback-private.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-region-private.h" #include "cairo-spans-private.h" diff --git a/src/cairo-surface-wrapper.c b/src/cairo-surface-wrapper.c index c5fe44df..d03c2030 100644 --- a/src/cairo-surface-wrapper.c +++ b/src/cairo-surface-wrapper.c @@ -37,6 +37,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-surface-wrapper-private.h" /* A collection of routines to facilitate surface wrapping */ diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 9aa707f5..5753277e 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -40,6 +40,7 @@ #include "cairo-surface-fallback-private.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-recording-surface-private.h" #include "cairo-region-private.h" #include "cairo-tee-surface-private.h" diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index fa25b821..88765f30 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -43,6 +43,7 @@ #include "cairoint.h" #include "cairo-svg.h" #include "cairo-analysis-surface-private.h" +#include "cairo-error-private.h" #include "cairo-image-info-private.h" #include "cairo-recording-surface-private.h" #include "cairo-output-stream-private.h" diff --git a/src/cairo-tee-surface.c b/src/cairo-tee-surface.c index 1111fa1b..76f4b9db 100644 --- a/src/cairo-tee-surface.c +++ b/src/cairo-tee-surface.c @@ -40,6 +40,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-tee-surface-private.h" #include "cairo-surface-wrapper-private.h" diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c index 29262c2d..d18b25aa 100644 --- a/src/cairo-tor-scan-converter.c +++ b/src/cairo-tor-scan-converter.c @@ -95,6 +95,7 @@ */ #include "cairoint.h" #include "cairo-spans-private.h" +#include "cairo-error-private.h" #include <assert.h> #include <stdlib.h> diff --git a/src/cairo-toy-font-face.c b/src/cairo-toy-font-face.c index e7c841a9..74177d77 100644 --- a/src/cairo-toy-font-face.c +++ b/src/cairo-toy-font-face.c @@ -41,6 +41,7 @@ #define _BSD_SOURCE /* for strdup() */ #include "cairoint.h" +#include "cairo-error-private.h" static const cairo_font_face_t _cairo_font_face_null_pointer = { diff --git a/src/cairo-traps.c b/src/cairo-traps.c index 70d4c69e..8c7e7a8d 100644 --- a/src/cairo-traps.c +++ b/src/cairo-traps.c @@ -39,6 +39,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-region-private.h" #include "cairo-slope-private.h" diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c index 3a813ee7..b006065e 100644 --- a/src/cairo-truetype-subset.c +++ b/src/cairo-truetype-subset.c @@ -42,6 +42,7 @@ #define _BSD_SOURCE /* for snprintf(), strdup() */ #include "cairoint.h" +#include "cairo-error-private.h" #if CAIRO_HAS_FONT_SUBSET diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c index 1023bbdc..e43fd40d 100644 --- a/src/cairo-type1-fallback.c +++ b/src/cairo-type1-fallback.c @@ -35,6 +35,7 @@ #define _BSD_SOURCE /* for snprintf(), strdup() */ #include "cairoint.h" +#include "cairo-error-private.h" #if CAIRO_HAS_FONT_SUBSET diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c index 7ded39a4..0c4e0a59 100644 --- a/src/cairo-type1-subset.c +++ b/src/cairo-type1-subset.c @@ -41,6 +41,7 @@ #define _BSD_SOURCE /* for snprintf(), strdup() */ #include "cairoint.h" +#include "cairo-error-private.h" #if CAIRO_HAS_FONT_SUBSET diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c index 6878bbaa..60698d4c 100644 --- a/src/cairo-type3-glyph-surface.c +++ b/src/cairo-type3-glyph-surface.c @@ -42,6 +42,7 @@ #include "cairo-output-stream-private.h" #include "cairo-recording-surface-private.h" #include "cairo-analysis-surface-private.h" +#include "cairo-error-private.h" #include "cairo-surface-clipper-private.h" static const cairo_surface_backend_t cairo_type3_glyph_surface_backend; diff --git a/src/cairo-unicode.c b/src/cairo-unicode.c index b1567d42..5bb6604c 100644 --- a/src/cairo-unicode.c +++ b/src/cairo-unicode.c @@ -41,6 +41,7 @@ */ #include "cairoint.h" +#include "cairo-error-private.h" #define UTF8_COMPUTE(Char, Mask, Len) \ if (Char < 128) \ diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c index 3304392f..d73a71ac 100644 --- a/src/cairo-user-font.c +++ b/src/cairo-user-font.c @@ -38,6 +38,7 @@ #include "cairo-user-font-private.h" #include "cairo-recording-surface-private.h" #include "cairo-analysis-surface-private.h" +#include "cairo-error-private.h" typedef struct _cairo_user_scaled_font_methods { cairo_user_scaled_font_init_func_t init; diff --git a/src/cairo-vg-surface.c b/src/cairo-vg-surface.c index 5ca01b6e..30da7eaa 100644 --- a/src/cairo-vg-surface.c +++ b/src/cairo-vg-surface.c @@ -38,10 +38,11 @@ #include "cairo-vg.h" +#include "cairo-cache-private.h" +#include "cairo-error-private.h" #include "cairo-path-fixed-private.h" #include "cairo-recording-surface-private.h" #include "cairo-surface-clipper-private.h" -#include "cairo-cache-private.h" #include <pixman.h> #include <VG/openvg.h> diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c index 7a86cc8c..bb4f1b03 100644 --- a/src/cairo-win32-font.c +++ b/src/cairo-win32-font.c @@ -45,6 +45,7 @@ #include "cairoint.h" #include "cairo-win32-private.h" +#include "cairo-error-private.h" #ifndef SPI_GETFONTSMOOTHINGTYPE #define SPI_GETFONTSMOOTHINGTYPE 0x200a diff --git a/src/cairo-win32-printing-surface.c b/src/cairo-win32-printing-surface.c index 173c9334..aff71ec0 100644 --- a/src/cairo-win32-printing-surface.c +++ b/src/cairo-win32-printing-surface.c @@ -46,6 +46,7 @@ #include "cairoint.h" +#include "cairo-error-private.h" #include "cairo-paginated-private.h" #include "cairo-clip-private.h" diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c index c250668f..0ec48be8 100644 --- a/src/cairo-win32-surface.c +++ b/src/cairo-win32-surface.c @@ -48,6 +48,7 @@ #include "cairoint.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-paginated-private.h" #include "cairo-win32-private.h" #include "cairo-scaled-font-subsets-private.h" diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c index 8cd82f02..1932c4ed 100644 --- a/src/cairo-xcb-surface.c +++ b/src/cairo-xcb-surface.c @@ -38,8 +38,9 @@ #include "cairo-xcb.h" #include "cairo-xcb-xrender.h" #include "cairo-clip-private.h" -#include "cairo-list-private.h" +#include "cairo-error-private.h" #include "cairo-freelist-private.h" +#include "cairo-list-private.h" #include <xcb/xcb_renderutil.h> #define AllPlanes ((unsigned long)~0L) diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c index 56ea7c8c..d8715c62 100644 --- a/src/cairo-xlib-display.c +++ b/src/cairo-xlib-display.c @@ -38,6 +38,7 @@ #include "cairo-xlib-private.h" #include "cairo-xlib-xrender-private.h" +#include "cairo-error-private.h" #include "cairo-freelist-private.h" #include <X11/Xlibint.h> /* For XESetCloseDisplay */ diff --git a/src/cairo-xlib-screen.c b/src/cairo-xlib-screen.c index 09a2a810..699b7d53 100644 --- a/src/cairo-xlib-screen.c +++ b/src/cairo-xlib-screen.c @@ -58,6 +58,7 @@ #include "cairo-xlib-xrender-private.h" #include "cairo-xlib-surface-private.h" +#include "cairo-error-private.h" #include <fontconfig/fontconfig.h> diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 7e5935d3..544e7339 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -50,6 +50,7 @@ #include "cairo-xlib-private.h" #include "cairo-xlib-surface-private.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-scaled-font-private.h" #include "cairo-region-private.h" diff --git a/src/cairo-xlib-visual.c b/src/cairo-xlib-visual.c index 7dbe86c2..aa167221 100644 --- a/src/cairo-xlib-visual.c +++ b/src/cairo-xlib-visual.c @@ -37,6 +37,8 @@ #include "cairo-xlib-private.h" +#include "cairo-error-private.h" + /* A perceptual distance metric between two colors. No sqrt needed * since the square of the distance is still a valid metric. */ diff --git a/src/cairo-xml-surface.c b/src/cairo-xml-surface.c index 25e0bb22..f32ea9d6 100644 --- a/src/cairo-xml-surface.c +++ b/src/cairo-xml-surface.c @@ -45,6 +45,7 @@ #include "cairo-xml.h" #include "cairo-clip-private.h" +#include "cairo-error-private.h" #include "cairo-output-stream-private.h" #include "cairo-recording-surface-private.h" diff --git a/src/cairo.c b/src/cairo.c index 3c9d892e..4be3e449 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -40,6 +40,7 @@ #include "cairo-private.h" #include "cairo-arc-private.h" +#include "cairo-error-private.h" #include "cairo-path-private.h" #define CAIRO_TOLERANCE_MINIMUM _cairo_fixed_to_double(1) diff --git a/src/cairoint.h b/src/cairoint.h index 14a9491d..a2243478 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -2618,18 +2618,6 @@ _cairo_utf8_to_utf16 (const char *str, int *items_written); #endif -#define _cairo_status_is_error(status) \ - (status != CAIRO_STATUS_SUCCESS && status <= CAIRO_STATUS_LAST_STATUS) - -cairo_private cairo_status_t -_cairo_error (cairo_status_t status); - -/* hide compiler warnings when discarding the return value */ -#define _cairo_error_throw(status) do { \ - cairo_status_t status__ = _cairo_error (status); \ - (void) status__; \ -} while (0) - /* Avoid unnecessary PLT entries. */ slim_hidden_proto (cairo_clip_preserve); slim_hidden_proto (cairo_close_path); diff --git a/src/drm/cairo-drm-bo.c b/src/drm/cairo-drm-bo.c index 3346fc97..980484a2 100644 --- a/src/drm/cairo-drm-bo.c +++ b/src/drm/cairo-drm-bo.c @@ -31,6 +31,7 @@ #include "cairo-drm-private.h" #include "cairo-drm-ioctl-private.h" +#include "cairo-error-private.h" #include <sys/ioctl.h> #include <errno.h> diff --git a/src/drm/cairo-drm-intel-surface.c b/src/drm/cairo-drm-intel-surface.c index 2152c591..b69eaf3c 100644 --- a/src/drm/cairo-drm-intel-surface.c +++ b/src/drm/cairo-drm-intel-surface.c @@ -31,6 +31,7 @@ #include "cairo-drm-private.h" #include "cairo-drm-intel-private.h" +#include "cairo-error-private.h" /* Basic generic/stub surface for intel chipsets */ diff --git a/src/drm/cairo-drm-intel.c b/src/drm/cairo-drm-intel.c index 5a37f00b..6c8a8fd2 100644 --- a/src/drm/cairo-drm-intel.c +++ b/src/drm/cairo-drm-intel.c @@ -32,6 +32,7 @@ #include "cairo-drm-private.h" #include "cairo-drm-ioctl-private.h" #include "cairo-drm-intel-private.h" +#include "cairo-error-private.h" #include "cairo-freelist-private.h" #include <sys/ioctl.h> diff --git a/src/drm/cairo-drm-radeon-surface.c b/src/drm/cairo-drm-radeon-surface.c index 94931626..7a26be44 100644 --- a/src/drm/cairo-drm-radeon-surface.c +++ b/src/drm/cairo-drm-radeon-surface.c @@ -31,6 +31,7 @@ #include "cairo-drm-private.h" #include "cairo-drm-radeon-private.h" +#include "cairo-error-private.h" /* Basic stub surface for radeon chipsets */ diff --git a/src/drm/cairo-drm-radeon.c b/src/drm/cairo-drm-radeon.c index 9654be6c..e435d705 100644 --- a/src/drm/cairo-drm-radeon.c +++ b/src/drm/cairo-drm-radeon.c @@ -32,6 +32,7 @@ #include "cairo-drm-private.h" #include "cairo-drm-radeon-private.h" #include "cairo-drm-ioctl-private.h" +#include "cairo-error-private.h" #include <sys/ioctl.h> #include <sys/mman.h> diff --git a/src/drm/cairo-drm-surface.c b/src/drm/cairo-drm-surface.c index 860d0992..a8f9ab15 100644 --- a/src/drm/cairo-drm-surface.c +++ b/src/drm/cairo-drm-surface.c @@ -33,6 +33,7 @@ #include "cairoint.h" #include "cairo-drm-private.h" +#include "cairo-error-private.h" #include "cairo-surface-fallback-private.h" cairo_surface_t * diff --git a/src/drm/cairo-drm.c b/src/drm/cairo-drm.c index 9d227b3b..a218fa52 100644 --- a/src/drm/cairo-drm.c +++ b/src/drm/cairo-drm.c @@ -33,6 +33,7 @@ #include "cairoint.h" #include "cairo-drm-private.h" +#include "cairo-error-private.h" #define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE #include <libudev.h> diff --git a/src/test-fallback-surface.c b/src/test-fallback-surface.c index 3b62e55b..78f339f0 100644 --- a/src/test-fallback-surface.c +++ b/src/test-fallback-surface.c @@ -54,6 +54,7 @@ #include "cairoint.h" #include "test-fallback-surface.h" +#include "cairo-error-private.h" typedef struct _test_fallback_surface { cairo_surface_t base; diff --git a/src/test-fallback16-surface.c b/src/test-fallback16-surface.c index 91699efc..45a7b465 100644 --- a/src/test-fallback16-surface.c +++ b/src/test-fallback16-surface.c @@ -43,6 +43,7 @@ #include "cairoint.h" #include "test-fallback16-surface.h" +#include "cairo-error-private.h" typedef struct _test_fallback16_surface { cairo_surface_t base; diff --git a/src/test-null-surface.c b/src/test-null-surface.c index 59761a39..5a260bbb 100644 --- a/src/test-null-surface.c +++ b/src/test-null-surface.c @@ -40,6 +40,8 @@ #include "test-null-surface.h" +#include "cairo-error-private.h" + slim_hidden_proto (_cairo_test_null_surface_create); static cairo_int_status_t diff --git a/src/test-paginated-surface.c b/src/test-paginated-surface.c index 164d4a71..62e5cb6b 100644 --- a/src/test-paginated-surface.c +++ b/src/test-paginated-surface.c @@ -49,6 +49,7 @@ #include "test-paginated-surface.h" +#include "cairo-error-private.h" #include "cairo-paginated-private.h" typedef struct _test_paginated_surface { diff --git a/src/test-wrapping-surface.c b/src/test-wrapping-surface.c index a634b48a..d76218f8 100644 --- a/src/test-wrapping-surface.c +++ b/src/test-wrapping-surface.c @@ -43,6 +43,7 @@ #include "test-wrapping-surface.h" +#include "cairo-error-private.h" #include "cairo-surface-wrapper-private.h" typedef struct _test_wrapping_surface { |