1*c2c66affSColin Finck /* @(#)align.h 1.11 13/07/23 Copyright 1995-2013 J. Schilling */ 2*c2c66affSColin Finck /* 3*c2c66affSColin Finck * Platform dependent definitions for aligning data. 4*c2c66affSColin Finck * 5*c2c66affSColin Finck * Copyright (c) 1995-2013 J. Schilling 6*c2c66affSColin Finck */ 7*c2c66affSColin Finck /* 8*c2c66affSColin Finck * The contents of this file are subject to the terms of the 9*c2c66affSColin Finck * Common Development and Distribution License, Version 1.0 only 10*c2c66affSColin Finck * (the "License"). You may not use this file except in compliance 11*c2c66affSColin Finck * with the License. 12*c2c66affSColin Finck * 13*c2c66affSColin Finck * See the file CDDL.Schily.txt in this distribution for details. 14*c2c66affSColin Finck * A copy of the CDDL is also available via the Internet at 15*c2c66affSColin Finck * http://www.opensource.org/licenses/cddl1.txt 16*c2c66affSColin Finck * 17*c2c66affSColin Finck * When distributing Covered Code, include this CDDL HEADER in each 18*c2c66affSColin Finck * file and include the License file CDDL.Schily.txt from this distribution. 19*c2c66affSColin Finck */ 20*c2c66affSColin Finck 21*c2c66affSColin Finck /* 22*c2c66affSColin Finck * The automatically created included file defines the following macros: 23*c2c66affSColin Finck * 24*c2c66affSColin Finck * saligned(a) One parameter aligned for a "short int" 25*c2c66affSColin Finck * s2aligned(a, b) Both parameters aligned for a "short int" 26*c2c66affSColin Finck * ialigned(a) One parameter aligned for a "int" 27*c2c66affSColin Finck * i2aligned(a, b) Both parameters aligned for a "int" 28*c2c66affSColin Finck * laligned(a) One parameter aligned for a "long" 29*c2c66affSColin Finck * l2aligned(a, b) Both parameters aligned for a "long" 30*c2c66affSColin Finck * llaligned(a) One parameter aligned for a "long long" 31*c2c66affSColin Finck * ll2aligned(a, b) Both parameters aligned for a "long long" 32*c2c66affSColin Finck * faligned(a) One parameter aligned for a "float" 33*c2c66affSColin Finck * f2aligned(a, b) Both parameters aligned for a "float" 34*c2c66affSColin Finck * daligned(a) One parameter aligned for a "double" 35*c2c66affSColin Finck * d2aligned(a, b) Both parameters aligned for a "double" 36*c2c66affSColin Finck * paligned(a) One parameter aligned for a "pointer" 37*c2c66affSColin Finck * p2aligned(a, b) Both parameters aligned for a "pointe" 38*c2c66affSColin Finck * 39*c2c66affSColin Finck * salign(x) Align for a "short int" 40*c2c66affSColin Finck * ialign(x) Align for a "int" 41*c2c66affSColin Finck * lalign(x) Align for a "long" 42*c2c66affSColin Finck * llalign(x) Align for a "long long" 43*c2c66affSColin Finck * falign(x) Align for a "float" 44*c2c66affSColin Finck * dalign(x) Align for a "double" 45*c2c66affSColin Finck * palign(x) Align for a "pointer" 46*c2c66affSColin Finck */ 47*c2c66affSColin Finck #ifndef _SCHILY_ALIGN_H 48*c2c66affSColin Finck #define _SCHILY_ALIGN_H 49*c2c66affSColin Finck 50*c2c66affSColin Finck #ifndef _SCHILY_MCONFIG_H 51*c2c66affSColin Finck #include <schily/mconfig.h> 52*c2c66affSColin Finck #endif 53*c2c66affSColin Finck 54*c2c66affSColin Finck #ifndef _SCHILY_UTYPES_H 55*c2c66affSColin Finck #include <schily/utypes.h> 56*c2c66affSColin Finck #endif 57*c2c66affSColin Finck 58*c2c66affSColin Finck #ifdef SCHILY_BUILD /* #defined by Schily makefile system */ 59*c2c66affSColin Finck /* 60*c2c66affSColin Finck * Include $(SRCROOT)/incs/$(OARCH)/align.h via 61*c2c66affSColin Finck * -I$(SRCROOT)/incs/$(OARCH)/ 62*c2c66affSColin Finck */ 63*c2c66affSColin Finck # include <align.h> 64*c2c66affSColin Finck #else /* !SCHILY_BUILD */ 65*c2c66affSColin Finck /* 66*c2c66affSColin Finck * The stuff for static compilation. Include files from a previous 67*c2c66affSColin Finck * dynamic autoconfiguration. 68*c2c66affSColin Finck */ 69*c2c66affSColin Finck #ifdef __SUNOS5_SPARC_CC32 70*c2c66affSColin Finck #include <schily/sparc-sunos5-cc/align.h> 71*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 72*c2c66affSColin Finck #endif 73*c2c66affSColin Finck #ifdef __SUNOS5_SPARC_CC64 74*c2c66affSColin Finck #include <schily/sparc-sunos5-cc64/align.h> 75*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 76*c2c66affSColin Finck #endif 77*c2c66affSColin Finck #ifdef __SUNOS5_SPARC_GCC32 78*c2c66affSColin Finck #include <schily/sparc-sunos5-gcc/align.h> 79*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 80*c2c66affSColin Finck #endif 81*c2c66affSColin Finck #ifdef __SUNOS5_SPARC_GCC64 82*c2c66affSColin Finck #include <schily/sparc-sunos5-gcc64/align.h> 83*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 84*c2c66affSColin Finck #endif 85*c2c66affSColin Finck #ifdef __SUNOS5_X86_CC32 86*c2c66affSColin Finck #include <schily/i386-sunos5-cc/align.h> 87*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 88*c2c66affSColin Finck #endif 89*c2c66affSColin Finck #ifdef __SUNOS5_X86_CC64 90*c2c66affSColin Finck #include <schily/i386-sunos5-cc64/align.h> 91*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 92*c2c66affSColin Finck #endif 93*c2c66affSColin Finck #ifdef __SUNOS5_X86_GCC32 94*c2c66affSColin Finck #include <schily/i386-sunos5-gcc/align.h> 95*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 96*c2c66affSColin Finck #endif 97*c2c66affSColin Finck #ifdef __SUNOS5_X86_GCC64 98*c2c66affSColin Finck #include <schily/i386-sunos5-gcc64/align.h> 99*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 100*c2c66affSColin Finck #endif 101*c2c66affSColin Finck 102*c2c66affSColin Finck #ifdef __HPUX_HPPA_CC32 103*c2c66affSColin Finck #include <schily/hppa-hp-ux-cc/align.h> 104*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 105*c2c66affSColin Finck #endif 106*c2c66affSColin Finck #ifdef __HPUX_HPPA_CC64 107*c2c66affSColin Finck #include <schily/hppa-hp-ux-cc64/align.h> 108*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 109*c2c66affSColin Finck #endif 110*c2c66affSColin Finck #ifdef __HPUX_HPPA_GCC32 111*c2c66affSColin Finck #include <schily/hppa-hp-ux-gcc/align.h> 112*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 113*c2c66affSColin Finck #endif 114*c2c66affSColin Finck #ifdef __HPUX_HPPA_GCC64 115*c2c66affSColin Finck #include <schily/hppa-hp-ux-gcc64/align.h> 116*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 117*c2c66affSColin Finck #endif 118*c2c66affSColin Finck 119*c2c66affSColin Finck #ifdef __LINUX_ARMV6L_GCC32 120*c2c66affSColin Finck #include <schily/armv6l-linux-gcc/align.h> 121*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 122*c2c66affSColin Finck #endif 123*c2c66affSColin Finck #ifdef __LINUX_ARMV5L_GCC32 124*c2c66affSColin Finck #include <schily/armv6l-linux-gcc/align.h> 125*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 126*c2c66affSColin Finck #endif 127*c2c66affSColin Finck #ifdef __LINUX_ARMV5TEJL_GCC32 128*c2c66affSColin Finck #include <schily/armv5tejl-linux-gcc/align.h> 129*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 130*c2c66affSColin Finck #endif 131*c2c66affSColin Finck #ifdef __LINUX_I386_GCC32 132*c2c66affSColin Finck #include <schily/i686-linux-gcc/align.h> 133*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 134*c2c66affSColin Finck #endif 135*c2c66affSColin Finck #ifdef __LINUX_amd64_GCC64 136*c2c66affSColin Finck #include <schily/x86_64-linux-gcc/align.h> 137*c2c66affSColin Finck #define __JS_ARCH_CONF_INCL 138*c2c66affSColin Finck #endif 139*c2c66affSColin Finck 140*c2c66affSColin Finck #ifdef __MSWIN_X86_CL32 141*c2c66affSColin Finck #include <schily/i686-cygwin32_nt-cl/align.h> 142*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 143*c2c66affSColin Finck #endif 144*c2c66affSColin Finck 145*c2c66affSColin Finck #ifdef __CYGWIN_X86_GCC 146*c2c66affSColin Finck #include <schily/i686-cygwin32_nt-gcc/align.h> 147*c2c66affSColin Finck #define __JS_ARCH_ALIGN_INCL 148*c2c66affSColin Finck #endif 149*c2c66affSColin Finck 150*c2c66affSColin Finck #ifndef __JS_ARCH_ALIGN_INCL 151*c2c66affSColin Finck /* 152*c2c66affSColin Finck * #error will not work for all compilers (e.g. sunos4) 153*c2c66affSColin Finck * The following line will abort compilation on all compilers 154*c2c66affSColin Finck * if none of the above is defined. And that's what we want. 155*c2c66affSColin Finck */ 156*c2c66affSColin Finck Error unconfigured architecture 157*c2c66affSColin Finck 158*c2c66affSColin Finck #include <schily/err_arch.h> /* Avoid "unknown directive" with K&R */ 159*c2c66affSColin Finck #endif 160*c2c66affSColin Finck 161*c2c66affSColin Finck #endif /* SCHILY_BUILD */ 162*c2c66affSColin Finck 163*c2c66affSColin Finck #ifdef __cplusplus 164*c2c66affSColin Finck extern "C" { 165*c2c66affSColin Finck #endif 166*c2c66affSColin Finck /* 167*c2c66affSColin Finck * Fake in order to keep the silly hdrchk(1) quiet. 168*c2c66affSColin Finck */ 169*c2c66affSColin Finck #ifdef __cplusplus 170*c2c66affSColin Finck } 171*c2c66affSColin Finck #endif 172*c2c66affSColin Finck 173*c2c66affSColin Finck #endif /* _SCHILY_ALIGN_H */ 174