param.h revision 75831
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 75831 2001-04-22 17:06:12Z asmodai $ 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 */ 6512099Sjoerg#ifdef __alpha__ 6612099Sjoerg#define PTRDIFF_IS_LONG 1 6712099Sjoerg#define SIZEOF_IS_ULONG 1 6812099Sjoerg#elif __i386__ 6912099Sjoerg#define PTRDIFF_IS_LONG 0 7012099Sjoerg#define SIZEOF_IS_ULONG 0 7112099Sjoerg#elif __m68k__ 7212099Sjoerg#define PTRDIFF_IS_LONG 0 7312099Sjoerg#define SIZEOF_IS_ULONG 0 7412099Sjoerg#elif __ns32k__ 7512099Sjoerg#define PTRDIFF_IS_LONG 0 7612099Sjoerg#define SIZEOF_IS_ULONG 0 7712099Sjoerg#elif __sparc__ 7812099Sjoerg#define PTRDIFF_IS_LONG 0 7912099Sjoerg#define SIZEOF_IS_ULONG 0 8012099Sjoerg#elif __vax__ 8112099Sjoerg#define PTRDIFF_IS_LONG 0 8212099Sjoerg#define SIZEOF_IS_ULONG 0 8312099Sjoerg#else 8412099Sjoerg#error unknown machine type 8512099Sjoerg#endif 8612099Sjoerg 8712099Sjoerg/* 8812099Sjoerg * Make sure this matches wchar_t. 8912099Sjoerg */ 9012099Sjoerg#define WCHAR SHORT 9112099Sjoerg 9212099Sjoerg#ifndef __GNUC__ 9312099Sjoerg#ifndef lint 9412099Sjoerg#ifndef QUAD_MAX /* necessary for mkdep */ 9512099Sjoerg#define QUAD_MAX LONG_MAX 9612099Sjoerg#define QUAD_MIN LONG_MIN 9712099Sjoerg#define UQUAD_MAX ULONG_MAX 9812099Sjoerg#endif 9912099Sjoergtypedef long quad_t; 10012099Sjoergtypedef u_long u_quad_t; 10112099Sjoerg#endif 10212099Sjoerg#endif 10312099Sjoerg 10412099Sjoerg 10512099Sjoerg/* 10612099Sjoerg * long double only in ANSI C. 10712099Sjoerg */ 10812099Sjoerg#ifdef __STDC__ 10912099Sjoergtypedef long double ldbl_t; 11012099Sjoerg#else 11112099Sjoergtypedef double ldbl_t; 11212099Sjoerg#endif 11312099Sjoerg 11412099Sjoerg/* 11512099Sjoerg * Some traditional compilers are not able to assign structures. 11612099Sjoerg */ 11712099Sjoerg#ifdef __STDC__ 11812099Sjoerg#define STRUCT_ASSIGN(dest, src) (dest) = (src) 11912099Sjoerg#else 12012099Sjoerg#define STRUCT_ASSIGN(dest, src) (void)memcpy(&(dest), &(src), \ 12112099Sjoerg sizeof (dest)); 12212099Sjoerg#endif 123