+#endif /* !RUNEOFF32 */
+
+#if defined(__LP64__) || defined(RUNEOFF32)
+/*
+ * Because the LC_CTYPE files were created with a 32-bit program, we need
+ * to adjust for the larger pointers in LP64 (the longs have already been
+ * replaced by 32-bit equivalents). Also, natural alignment will pad
+ * 64-bit types to 8-byte boundaries, and make structures containing
+ * 64-bit types sized to 8-byte boundaries.
+ */
+#include <stddef.h>
+#ifndef RUNEOFF32
+#include "rune32.h"
+#define BYTES32BITS 4
+#define BYTES64BITS 8
+/* whether to skip over a pointer or not (one-to-one with off64) */
+int skip[] = {
+ 1,
+ 1,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ 1,
+ 0
+};
+#endif /* !RUNEOFF32 */
+int off64[] = {
+ offsetof(_RuneLocale, __sgetrune),
+ offsetof(_RuneLocale, __sputrune),
+ offsetof(_RuneLocale, __runetype_ext),
+ offsetof(_RuneLocale, __runetype_ext) + offsetof(_RuneRange, __ranges),
+ offsetof(_RuneLocale, __maplower_ext),
+ offsetof(_RuneLocale, __maplower_ext) + offsetof(_RuneRange, __ranges),
+ offsetof(_RuneLocale, __mapupper_ext),
+ offsetof(_RuneLocale, __mapupper_ext) + offsetof(_RuneRange, __ranges),
+ offsetof(_RuneLocale, __variable),
+ offsetof(_RuneLocale, __charclasses),
+ sizeof(_RuneLocale)
+};
+#define NOFF (sizeof(off64) / sizeof(int))
+#ifdef RUNEOFF32
+/*
+ * This program generates a header file (on stdout) that containes the 32-bit
+ * offsets, plus some 32-bit sizes
+ */
+main()
+{
+ int i;
+ printf("#define SIZEOF32_RUNEENTRY %d\n", sizeof(_RuneEntry));
+ printf("#define SIZEOF32_RUNELOCALE %d\n", sizeof(_RuneLocale));
+ printf("int off32[] = {\n");
+ for(i = 0; i < NOFF; i++)
+ printf("\t%d,\n", off64[i]);
+ printf("};\n");
+ return 0;
+}
+#endif /* RUNEOFF32 */
+#else /* !__LP64__ && !RUNEOFF32 */
+#define SIZEOF32_RUNELOCALE sizeof(_RuneLocale)
+#endif /* __LP64__ || RUNEOFF32 */