summaryrefslogtreecommitdiff
path: root/base/genarch.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2019-07-03 15:23:46 +0100
committerRobin Watts <Robin.Watts@artifex.com>2019-07-03 18:38:20 +0100
commit761a8b513a28a9c4f4f1e83150556e7407f0d74a (patch)
tree91307ff68f01f6d80d7664c0e0a328e6945b0bef /base/genarch.c
parentd306e93d487a6539804c6343986bcbca2ecc37a8 (diff)
downloadghostpdl-761a8b513a28a9c4f4f1e83150556e7407f0d74a.tar.gz
Add size_t definitions to genarch.
Diffstat (limited to 'base/genarch.c')
-rw-r--r--base/genarch.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/genarch.c b/base/genarch.c
index 6dd5daa5d..c3a632771 100644
--- a/base/genarch.c
+++ b/base/genarch.c
@@ -129,6 +129,10 @@ main(int argc, char *argv[])
char c;
double d;
} sd;
+ struct {
+ char c;
+ size_t z;
+ } sz;
long lm1 = -1;
long lr1 = lm1 >> 1, lr2 = lm1 >> 2;
int im1 = -1;
@@ -180,6 +184,7 @@ main(int argc, char *argv[])
define_int(f, "ARCH_ALIGN_SHORT_MOD", OFFSET_IN(ss, s));
define_int(f, "ARCH_ALIGN_INT_MOD", OFFSET_IN(si, i));
define_int(f, "ARCH_ALIGN_LONG_MOD", OFFSET_IN(sl, l));
+ define_int(f, "ARCH_ALIGN_SIZE_T_MOD", OFFSET_IN(sz, z));
#if defined (GS_MEMPTR_ALIGNMENT) && GS_MEMPTR_ALIGNMENT != 0
define_int(f, "ARCH_ALIGN_PTR_MOD", GS_MEMPTR_ALIGNMENT);
@@ -209,6 +214,7 @@ main(int argc, char *argv[])
define_int(f, "ARCH_LOG2_SIZEOF_SHORT", ilog2(size_of(short)));
define_int(f, "ARCH_LOG2_SIZEOF_INT", ilog2(size_of(int)));
define_int(f, "ARCH_LOG2_SIZEOF_LONG", ilog2(size_of(long)));
+ define_int(f, "ARCH_LOG2_SIZEOF_SIZE_T", ilog2(size_of(size_t)));
#if !defined(_MSC_VER) && ! (defined(__BORLANDC__) && defined(__WIN32__))
/* MSVC does not provide 'long long' but we need this on some archs
to define a 64 bit type. A corresponding #ifdef in stdint_.h handles
@@ -216,6 +222,7 @@ main(int argc, char *argv[])
they have a 64 bit type at all */
define_int(f, "ARCH_LOG2_SIZEOF_LONG_LONG", ilog2(size_of(long long)));
#endif
+ define_int(f, "ARCH_SIZEOF_SIZE_T", size_of(size_t));
define_int(f, "ARCH_SIZEOF_GX_COLOR_INDEX", sizeof(GX_COLOR_INDEX_TYPE));
define_int(f, "ARCH_SIZEOF_PTR", size_of(char *));
define_int(f, "ARCH_SIZEOF_FLOAT", size_of(float));
@@ -258,6 +265,8 @@ main(int argc, char *argv[])
fprintf(f, "((unsigned int)~0 + (unsigned int)0)\n");
define(f, "ARCH_MAX_ULONG");
fprintf(f, "((unsigned long)~0L + (unsigned long)0)\n");
+ define(f, "ARCH_MAX_SIZE_T");
+ fprintf(f, "((size_t)~0L + (size_t)0)\n");
#undef PRINT_MAX
section(f, "Miscellaneous");