summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-22 17:02:32 +0200
committerRobin Watts <robin.watts@artifex.com>2018-06-22 18:07:58 +0100
commit776c75656186a7f087832d4befc5d83154a132cb (patch)
treee295e302e8e05791af673c1a9cc054889f79ae98 /include
parent289a8b3bae2e076e58349943519611d4dad6c3cc (diff)
downloadmupdf-776c75656186a7f087832d4befc5d83154a132cb.tar.xz
Don't pollute namespace with our 'restrict' macro. Use FZ_RESTRICT instead.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/geometry.h22
-rw-r--r--include/mupdf/fitz/pixmap.h2
-rw-r--r--include/mupdf/fitz/system.h7
3 files changed, 16 insertions, 15 deletions
diff --git a/include/mupdf/fitz/geometry.h b/include/mupdf/fitz/geometry.h
index f36c884c..9ae058eb 100644
--- a/include/mupdf/fitz/geometry.h
+++ b/include/mupdf/fitz/geometry.h
@@ -293,7 +293,7 @@ static inline fz_matrix fz_make_matrix(float a, float b, float c, float d, float
return m;
}
-static inline fz_matrix *fz_copy_matrix(fz_matrix *restrict m, const fz_matrix *restrict s)
+static inline fz_matrix *fz_copy_matrix(fz_matrix *FZ_RESTRICT m, const fz_matrix *FZ_RESTRICT s)
{
*m = *s;
return m;
@@ -487,7 +487,7 @@ float fz_matrix_expansion(const fz_matrix *m); /* sumatrapdf */
Should both rectangles be infinite, then the intersection is
also infinite.
*/
-fz_rect *fz_intersect_rect(fz_rect *restrict a, const fz_rect *restrict b);
+fz_rect *fz_intersect_rect(fz_rect *FZ_RESTRICT a, const fz_rect *FZ_RESTRICT b);
/*
fz_intersect_irect: Compute intersection of two bounding boxes.
@@ -495,7 +495,7 @@ fz_rect *fz_intersect_rect(fz_rect *restrict a, const fz_rect *restrict b);
Similar to fz_intersect_rect but operates on two bounding
boxes instead of two rectangles.
*/
-fz_irect *fz_intersect_irect(fz_irect *restrict a, const fz_irect *restrict b);
+fz_irect *fz_intersect_irect(fz_irect *FZ_RESTRICT a, const fz_irect *FZ_RESTRICT b);
/*
fz_union_rect: Compute union of two rectangles.
@@ -507,7 +507,7 @@ fz_irect *fz_intersect_irect(fz_irect *restrict a, const fz_irect *restrict b);
non-empty rectangle. Should both rectangles be empty, then the
union is also empty.
*/
-fz_rect *fz_union_rect(fz_rect *restrict a, const fz_rect *restrict b);
+fz_rect *fz_union_rect(fz_rect *FZ_RESTRICT a, const fz_rect *FZ_RESTRICT b);
/*
fz_irect_from_rect: Convert a rect into the minimal bounding box
@@ -525,7 +525,7 @@ fz_rect *fz_union_rect(fz_rect *restrict a, const fz_rect *restrict b);
Returns bbox (updated).
*/
-fz_irect *fz_irect_from_rect(fz_irect *restrict bbox, const fz_rect *restrict rect);
+fz_irect *fz_irect_from_rect(fz_irect *FZ_RESTRICT bbox, const fz_rect *FZ_RESTRICT rect);
/*
fz_round_rect: Round rectangle coordinates.
@@ -541,7 +541,7 @@ fz_irect *fz_irect_from_rect(fz_irect *restrict bbox, const fz_rect *restrict re
allows for a small amount of rounding error when calculating
the bbox.
*/
-fz_irect *fz_round_rect(fz_irect *restrict bbox, const fz_rect *restrict rect);
+fz_irect *fz_round_rect(fz_irect *FZ_RESTRICT bbox, const fz_rect *FZ_RESTRICT rect);
/*
fz_rect_from_irect: Convert a bbox into a rect.
@@ -555,7 +555,7 @@ fz_irect *fz_round_rect(fz_irect *restrict bbox, const fz_rect *restrict rect);
Returns rect (updated).
*/
-fz_rect *fz_rect_from_irect(fz_rect *restrict rect, const fz_irect *restrict bbox);
+fz_rect *fz_rect_from_irect(fz_rect *FZ_RESTRICT rect, const fz_irect *FZ_RESTRICT bbox);
/*
fz_expand_rect: Expand a bbox by a given amount in all directions.
@@ -597,8 +597,8 @@ int fz_contains_rect(const fz_rect *a, const fz_rect *b);
Returns transform (unchanged).
*/
-fz_point *fz_transform_point(fz_point *restrict point, const fz_matrix *restrict transform);
-fz_point *fz_transform_point_xy(fz_point *restrict point, const fz_matrix *restrict transform, float x, float y);
+fz_point *fz_transform_point(fz_point *FZ_RESTRICT point, const fz_matrix *FZ_RESTRICT transform);
+fz_point *fz_transform_point_xy(fz_point *FZ_RESTRICT point, const fz_matrix *FZ_RESTRICT transform, float x, float y);
/*
fz_transform_vector: Apply a transformation to a vector.
@@ -609,7 +609,7 @@ fz_point *fz_transform_point_xy(fz_point *restrict point, const fz_matrix *restr
vector: Pointer to vector to update.
*/
-fz_point *fz_transform_vector(fz_point *restrict vector, const fz_matrix *restrict transform);
+fz_point *fz_transform_vector(fz_point *FZ_RESTRICT vector, const fz_matrix *FZ_RESTRICT transform);
/*
fz_transform_rect: Apply a transform to a rectangle.
@@ -626,7 +626,7 @@ fz_point *fz_transform_vector(fz_point *restrict vector, const fz_matrix *restri
fz_empty_rect and fz_infinite_rect, may be used but are
returned unchanged as expected.
*/
-fz_rect *fz_transform_rect(fz_rect *restrict rect, const fz_matrix *restrict transform);
+fz_rect *fz_transform_rect(fz_rect *FZ_RESTRICT rect, const fz_matrix *FZ_RESTRICT transform);
/*
fz_normalize_vector: Normalize a vector to length one.
diff --git a/include/mupdf/fitz/pixmap.h b/include/mupdf/fitz/pixmap.h
index b0422033..050f5aba 100644
--- a/include/mupdf/fitz/pixmap.h
+++ b/include/mupdf/fitz/pixmap.h
@@ -386,7 +386,7 @@ fz_irect *fz_pixmap_bbox_no_ctx(const fz_pixmap *src, fz_irect *bbox);
void fz_decode_tile(fz_context *ctx, fz_pixmap *pix, const float *decode);
void fz_decode_indexed_tile(fz_context *ctx, fz_pixmap *pix, const float *decode, int maxval);
-void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * restrict src, int n, int depth, size_t stride, int scale);
+void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * FZ_RESTRICT src, int n, int depth, size_t stride, int scale);
/*
fz_pixmap_converter: Color convert a pixmap. The passing of default_cs is needed due to the base cs of the image possibly
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index cabbcc21..1231f031 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -161,12 +161,13 @@ void fz_free_argv(int argc, char **argv);
/* restrict is standard in C99, but not in all C++ compilers. */
#if defined (__STDC_VERSION_) && (__STDC_VERSION__ >= 199901L) /* C99 */
+#define FZ_RESTRICT restrict
#elif defined(_MSC_VER) && (_MSC_VER >= 1600) /* MSVC 10 or newer */
-#define restrict __restrict
+#define FZ_RESTRICT __restrict
#elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC 3 or newer */
-#define restrict __restrict
+#define FZ_RESTRICT __restrict
#else /* Unknown or ancient */
-#define restrict
+#define FZ_RESTRICT
#endif
/* noreturn is a GCC extension */