diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2020-10-21 19:20:43 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2020-10-21 19:24:50 +0100 |
commit | b231780b739720451e8d6517b2e97a07908b7469 (patch) | |
tree | c6ada505fa6e6ea440070a423d078c4ee4124f11 /lcms2mt | |
parent | 337be82addaaf8740b60e2a0cf354ae96d46468f (diff) | |
download | ghostpdl-b231780b739720451e8d6517b2e97a07908b7469.tar.gz |
lcms2: automatically align blocks appropriately on sparc.
The sparc architecture requires pointers within structures to
be at 64bit alignment, even if they are 32bit pointers.
LCMS2 allows for this by having a CMS_PTR_ALIGNMENT symbol
that can be predefined. If it's not predefined, it defaults to
sizeof(void *).
We update the source here so that when building for sparc, it
defaults to 8. This shouldn't affect gs, as it sets the value
via configure/make. I believe our lcms2 repo as used in MuPDF
is autogenerated from this though, and this will help us there.
Diffstat (limited to 'lcms2mt')
-rw-r--r-- | lcms2mt/src/lcms2_internal.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lcms2mt/src/lcms2_internal.h b/lcms2mt/src/lcms2_internal.h index 129932820..175b3c998 100644 --- a/lcms2mt/src/lcms2_internal.h +++ b/lcms2mt/src/lcms2_internal.h @@ -62,7 +62,11 @@ // even though sizeof(void *) is only four: for greatest flexibility // allow the build to specify ptr alignment. #ifndef CMS_PTR_ALIGNMENT -# define CMS_PTR_ALIGNMENT sizeof(void *) +# if defined(sparc) || defined(__sparc) || defined(__sparc__) +# define CMS_PTR_ALIGNMENT 8 +# else +# define CMS_PTR_ALIGNMENT sizeof(void *) +# endif #endif #define _cmsALIGNMEM(x) (((x)+(CMS_PTR_ALIGNMENT - 1)) & ~(CMS_PTR_ALIGNMENT - 1)) |