param.h revision 114831
175831Sasmodai/* $NetBSD: param.h,v 1.4 1995/07/23 18:14:41 ragge Exp $ */ 212099Sjoerg 312099Sjoerg/* 412099Sjoerg * Copyright (c) 1994, 1995 Jochen Pohl 512099Sjoerg * All Rights Reserved. 612099Sjoerg * 712099Sjoerg * Redistribution and use in source and binary forms, with or without 812099Sjoerg * modification, are permitted provided that the following conditions 912099Sjoerg * are met: 1012099Sjoerg * 1. Redistributions of source code must retain the above copyright 1112099Sjoerg * notice, this list of conditions and the following disclaimer. 1212099Sjoerg * 2. Redistributions in binary form must reproduce the above copyright 1312099Sjoerg * notice, this list of conditions and the following disclaimer in the 1412099Sjoerg * documentation and/or other materials provided with the distribution. 1512099Sjoerg * 3. All advertising materials mentioning features or use of this software 1612099Sjoerg * must display the following acknowledgement: 1712099Sjoerg * This product includes software developed by Jochen Pohl for 1812099Sjoerg * The NetBSD Project. 1912099Sjoerg * 4. The name of the author may not be used to endorse or promote products 2012099Sjoerg * derived from this software without specific prior written permission. 2112099Sjoerg * 2212099Sjoerg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2312099Sjoerg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2412099Sjoerg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2512099Sjoerg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2612099Sjoerg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2712099Sjoerg * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2812099Sjoerg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2912099Sjoerg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3012099Sjoerg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3112099Sjoerg * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3275730Sasmodai * 3375730Sasmodai * $FreeBSD: head/usr.bin/xlint/lint1/param.h 114831 2003-05-08 06:33:49Z peter $ 3412099Sjoerg */ 3512099Sjoerg 3612099Sjoerg/* 3712099Sjoerg * Minimun size of string buffer. If this is not enough, the buffer 3812099Sjoerg * is enlarged in steps of STRBLEN bytes. 3912099Sjoerg */ 4012099Sjoerg#define STRBLEN 256 4112099Sjoerg 4212099Sjoerg/* 4312099Sjoerg * This defines the size of memory blocks which are used to allocate 4412099Sjoerg * memory in larger chunks. 4512099Sjoerg */ 4612099Sjoerg#define MBLKSIZ ((size_t)0x4000) 4712099Sjoerg 4812099Sjoerg/* 4912099Sjoerg * Sizes of hash tables 5012099Sjoerg * Should be a prime. Possible primes are 5112099Sjoerg * 307, 401, 503, 601, 701, 809, 907, 1009, 1103, 1201, 1301, 1409, 1511. 5212099Sjoerg * 5312099Sjoerg * HSHSIZ1 symbol table 1st pass 5412099Sjoerg * HSHSIZ2 symbol table 2nd pass 5512099Sjoerg * THSHSIZ2 type table 2nd pass 5612099Sjoerg */ 5712099Sjoerg#define HSHSIZ1 503 5812099Sjoerg#define HSHSIZ2 1009 5912099Sjoerg#define THSHSIZ2 1009 6012099Sjoerg 6112099Sjoerg/* 6212099Sjoerg * Should be set to 1 if the difference of two pointers is of type long 6312099Sjoerg * or the value of sizeof is of type unsigned long. 6412099Sjoerg */ 6584734Sdfr#ifdef __ia64__ 6612099Sjoerg#define PTRDIFF_IS_LONG 1 6712099Sjoerg#define SIZEOF_IS_ULONG 1 68114831Speter#elif __amd64__ 69114831Speter#define PTRDIFF_IS_LONG 1 70114831Speter#define SIZEOF_IS_ULONG 1 7184734Sdfr#elif __alpha__ 7284734Sdfr#define PTRDIFF_IS_LONG 1 7384734Sdfr#define SIZEOF_IS_ULONG 1 7412099Sjoerg#elif __i386__ 7512099Sjoerg#define PTRDIFF_IS_LONG 0 7612099Sjoerg#define SIZEOF_IS_ULONG 0 7712099Sjoerg#elif __m68k__ 7812099Sjoerg#define PTRDIFF_IS_LONG 0 7912099Sjoerg#define SIZEOF_IS_ULONG 0 8012099Sjoerg#elif __ns32k__ 8112099Sjoerg#define PTRDIFF_IS_LONG 0 8212099Sjoerg#define SIZEOF_IS_ULONG 0 83107716Sbenno#elif __powerpc__ 84107716Sbenno#define PTRDIFF_IS_LONG 0 85107716Sbenno#define SIZEOF_IS_ULONG 0 8612099Sjoerg#elif __sparc__ 8712099Sjoerg#define PTRDIFF_IS_LONG 0 8812099Sjoerg#define SIZEOF_IS_ULONG 0 8991977Sjake#elif __sparc64__ 9091977Sjake#define PTRDIFF_IS_LONG 1 9191977Sjake#define SIZEOF_IS_ULONG 1 9212099Sjoerg#elif __vax__ 9312099Sjoerg#define PTRDIFF_IS_LONG 0 9412099Sjoerg#define SIZEOF_IS_ULONG 0 9512099Sjoerg#else 9612099Sjoerg#error unknown machine type 9712099Sjoerg#endif 9812099Sjoerg 9912099Sjoerg/* 10012099Sjoerg * Make sure this matches wchar_t. 10112099Sjoerg */ 10212099Sjoerg#define WCHAR SHORT 10312099Sjoerg 10412099Sjoerg#ifndef __GNUC__ 10512099Sjoerg#ifndef lint 10612099Sjoerg#ifndef QUAD_MAX /* necessary for mkdep */ 10712099Sjoerg#define QUAD_MAX LONG_MAX 10812099Sjoerg#define QUAD_MIN LONG_MIN 10912099Sjoerg#define UQUAD_MAX ULONG_MAX 11012099Sjoerg#endif 11112099Sjoergtypedef long quad_t; 11212099Sjoergtypedef u_long u_quad_t; 11312099Sjoerg#endif 11412099Sjoerg#endif 11512099Sjoerg 11612099Sjoerg 11712099Sjoerg/* 11812099Sjoerg * long double only in ANSI C. 11912099Sjoerg */ 12012099Sjoerg#ifdef __STDC__ 12112099Sjoergtypedef long double ldbl_t; 12212099Sjoerg#else 12312099Sjoergtypedef double ldbl_t; 12412099Sjoerg#endif 12512099Sjoerg 12612099Sjoerg/* 12712099Sjoerg * Some traditional compilers are not able to assign structures. 12812099Sjoerg */ 12912099Sjoerg#ifdef __STDC__ 13012099Sjoerg#define STRUCT_ASSIGN(dest, src) (dest) = (src) 13112099Sjoerg#else 13212099Sjoerg#define STRUCT_ASSIGN(dest, src) (void)memcpy(&(dest), &(src), \ 13312099Sjoerg sizeof (dest)); 13412099Sjoerg#endif 135