From 7b4540abdf0bd78de26991818acaba1c63466067 Mon Sep 17 00:00:00 2001 From: Michael Haubenwallner Date: Thu, 26 Feb 2015 14:38:01 +0100 Subject: [PATCH] util/script: fix include order for AIX, bug#89339 At least for AIX it is necessary to really retain this include order: 1: ABI defining macros from "config.h" 2: system headers 3: local headers, declarations --- util/cairo-script/cairo-script-file.c | 6 +++++- util/cairo-script/cairo-script-hash.c | 6 +++++- util/cairo-script/cairo-script-interpreter.c | 10 +++++++--- util/cairo-script/cairo-script-objects.c | 6 +++++- util/cairo-script/cairo-script-operators.c | 13 ++++++++----- util/cairo-script/cairo-script-private.h | 4 ---- util/cairo-script/cairo-script-scanner.c | 6 +++++- util/cairo-script/cairo-script-stack.c | 6 +++++- util/cairo-script/csi-bind.c | 8 ++++++-- util/cairo-script/csi-exec.c | 8 ++++++-- util/cairo-script/csi-replay.c | 8 ++++++-- util/cairo-script/csi-trace.c | 8 ++++++-- 12 files changed, 64 insertions(+), 25 deletions(-) diff --git a/util/cairo-script/cairo-script-file.c b/util/cairo-script/cairo-script-file.c index 0274a3e..2dccb2f 100644 --- a/util/cairo-script/cairo-script-file.c +++ b/util/cairo-script/cairo-script-file.c @@ -32,7 +32,9 @@ * Chris Wilson */ -#include "cairo-script-private.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include /* INT_MAX */ @@ -43,6 +45,8 @@ #include #endif +#include "cairo-script-private.h" + #define CHUNK_SIZE 32768 #define OWN_STREAM 0x1 diff --git a/util/cairo-script/cairo-script-hash.c b/util/cairo-script/cairo-script-hash.c index 4d11103..b9d59ac 100644 --- a/util/cairo-script/cairo-script-hash.c +++ b/util/cairo-script/cairo-script-hash.c @@ -37,10 +37,14 @@ * Karl Tomlinson , Mozilla Corporation */ -#include "cairo-script-private.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include +#include "cairo-script-private.h" + /* * An entry can be in one of three states: * diff --git a/util/cairo-script/cairo-script-interpreter.c b/util/cairo-script/cairo-script-interpreter.c index 50170fc..da579ca 100644 --- a/util/cairo-script/cairo-script-interpreter.c +++ b/util/cairo-script/cairo-script-interpreter.c @@ -32,9 +32,9 @@ * Chris Wilson */ -#include - -#include "cairo-script-private.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -42,6 +42,10 @@ #include #include +#include + +#include "cairo-script-private.h" + #ifndef MAX #define MAX(a,b) (((a)>=(b))?(a):(b)) #endif diff --git a/util/cairo-script/cairo-script-objects.c b/util/cairo-script/cairo-script-objects.c index a625489..909669d 100644 --- a/util/cairo-script/cairo-script-objects.c +++ b/util/cairo-script/cairo-script-objects.c @@ -32,11 +32,15 @@ * Chris Wilson */ -#include "cairo-script-private.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include /* INT_MAX */ #include +#include "cairo-script-private.h" + csi_status_t csi_array_new (csi_t *ctx, csi_integer_t initial_size, diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c index 0d6cafc..eaeec05 100644 --- a/util/cairo-script/cairo-script-operators.c +++ b/util/cairo-script/cairo-script-operators.c @@ -33,11 +33,8 @@ */ /* TODO real path type */ - -#include "cairo-script-private.h" - -#if CAIRO_HAS_SCRIPT_SURFACE -#include "cairo-script.h" +#ifdef HAVE_CONFIG_H +#include "config.h" #endif #include /* snprintf */ @@ -70,6 +67,12 @@ # endif #endif +#include "cairo-script-private.h" + +#if CAIRO_HAS_SCRIPT_SURFACE +#include "cairo-script.h" +#endif + typedef struct _csi_proxy { csi_t *ctx; void *ptr; diff --git a/util/cairo-script/cairo-script-private.h b/util/cairo-script/cairo-script-private.h index 6bf41b4..3691b4f 100644 --- a/util/cairo-script/cairo-script-private.h +++ b/util/cairo-script/cairo-script-private.h @@ -35,10 +35,6 @@ #ifndef CAIRO_SCRIPT_PRIVATE_H #define CAIRO_SCRIPT_PRIVATE_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "cairo-script-interpreter.h" #include diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c index 4254aa0..bfc63c0 100644 --- a/util/cairo-script/cairo-script-scanner.c +++ b/util/cairo-script/cairo-script-scanner.c @@ -32,7 +32,9 @@ * Chris Wilson */ -#include "cairo-script-private.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include /* INT_MAX */ #include /* pow */ @@ -47,6 +49,8 @@ #include #endif +#include "cairo-script-private.h" + #define DEBUG_SCAN 0 #if WORDS_BIGENDIAN diff --git a/util/cairo-script/cairo-script-stack.c b/util/cairo-script/cairo-script-stack.c index b1d146c..91ff0eb 100644 --- a/util/cairo-script/cairo-script-stack.c +++ b/util/cairo-script/cairo-script-stack.c @@ -32,11 +32,15 @@ * Chris Wilson */ -#include "cairo-script-private.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include /* INT_MAX */ #include +#include "cairo-script-private.h" + csi_status_t _csi_stack_init (csi_t *ctx, csi_stack_t *stack, csi_integer_t size) { diff --git a/util/cairo-script/csi-bind.c b/util/cairo-script/csi-bind.c index 91b58fb..1645fe4 100644 --- a/util/cairo-script/csi-bind.c +++ b/util/cairo-script/csi-bind.c @@ -1,9 +1,13 @@ -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include +#include +#include + static cairo_status_t write_func (void *closure, const unsigned char *data, diff --git a/util/cairo-script/csi-exec.c b/util/cairo-script/csi-exec.c index d30b1c9..a5ba20c 100644 --- a/util/cairo-script/csi-exec.c +++ b/util/cairo-script/csi-exec.c @@ -1,9 +1,13 @@ -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include +#include +#include + static cairo_surface_t * _surface_create (void *closure, cairo_content_t content, diff --git a/util/cairo-script/csi-replay.c b/util/cairo-script/csi-replay.c index 67fed3b..3b072ae 100644 --- a/util/cairo-script/csi-replay.c +++ b/util/cairo-script/csi-replay.c @@ -1,10 +1,14 @@ -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include #include +#include +#include + static const cairo_user_data_key_t _key; #define SINGLE_SURFACE 1 diff --git a/util/cairo-script/csi-trace.c b/util/cairo-script/csi-trace.c index c57a56b..821fa42 100644 --- a/util/cairo-script/csi-trace.c +++ b/util/cairo-script/csi-trace.c @@ -1,10 +1,14 @@ -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include #include +#include +#include + static cairo_surface_t * _script_surface_create (void *closure, cairo_content_t content, -- 2.1.0