summaryrefslogtreecommitdiff
path: root/lcms2mt
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-10-21 19:20:43 +0100
committerRobin Watts <Robin.Watts@artifex.com>2020-10-21 19:24:50 +0100
commitb231780b739720451e8d6517b2e97a07908b7469 (patch)
treec6ada505fa6e6ea440070a423d078c4ee4124f11 /lcms2mt
parent337be82addaaf8740b60e2a0cf354ae96d46468f (diff)
downloadghostpdl-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.h6
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))