Fix 64-bit platforms: the ALIGNLONG macro aligned on an 32-bit word

boundary, which on 64-bit platforms is not the proper alignment for
longs. The patch replaces the hardcoding of 3 with sizeof(long)-1.

Tested on: ia64
This commit is contained in:
Marcel Moolenaar 2004-06-26 19:41:09 +00:00
parent 92000dedbc
commit 64cef1cadf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=112336
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- src/cmscgats.c.orig Sat Jun 26 12:31:08 2004
+++ src/cmscgats.c Sat Jun 26 12:33:13 2004
@@ -89,7 +89,7 @@
// ------------------------------------------------------------- Implementation
-#define ALIGNLONG(x) (((x)+3) & ~(3)) // Aligns to DWORD boundary
+#define ALIGNLONG(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) // Aligns to DWORD boundary
// #define STRICT_CGATS 1

View File

@ -0,0 +1,11 @@
--- src/cmsio1.c.orig Sat Jun 26 12:31:18 2004
+++ src/cmsio1.c Sat Jun 26 12:33:04 2004
@@ -72,7 +72,7 @@
// ------------------- implementation -----------------------------------
-#define ALIGNLONG(x) (((x)+3) & ~(3)) // Aligns to DWORD boundary
+#define ALIGNLONG(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) // Aligns to DWORD boundary
static size_t UsedSpace; // Using this makes writting of profiles non-reentrant!
static int GlobalLanguageCode; // Language & country descriptors, for ICC 4.0 support