1 /* $Header: /usr/people/sam/tiff/libtiff/RCS/tiffcomp.h,v 1.37 1994/09/29 17:29:40 sam Exp $ */ 2 3 /* 4 * Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler 5 * Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc. 6 * 7 * Permission to use, copy, modify, distribute, and sell this software and 8 * its documentation for any purpose is hereby granted without fee, provided 9 * that (i) the above copyright notices and this permission notice appear in 10 * all copies of the software and related documentation, and (ii) the names of 11 * Sam Leffler and Silicon Graphics may not be used in any advertising or 12 * publicity relating to the software without the specific, prior written 13 * permission of Sam Leffler and Silicon Graphics. 14 * 15 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 16 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 17 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 18 * 19 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 20 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 21 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 22 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 24 * OF THIS SOFTWARE. 25 */ 26 27 #ifndef _COMPAT_ 28 #define _COMPAT_ 29 /* 30 * This file contains a hodgepodge of definitions and 31 * declarations that are needed to provide compatibility 32 * between the native system and the base implementation 33 * that the library assumes. 34 * 35 * NB: This file is a mess. 36 */ 37 38 /* 39 * Setup basic type definitions and function declaratations. 40 */ 41 #if defined(__MWERKS__) || defined(THINK_C) 42 #include <unix.h> 43 #include <math.h> 44 #endif 45 #include <stdio.h> 46 #ifdef applec 47 #include <types.h> 48 #else 49 #if !defined(__MWERKS__) && !defined(THINK_C) 50 #include <sys/types.h> 51 #endif 52 #endif 53 #ifdef VMS 54 #include <file.h> 55 #include <unixio.h> 56 #else 57 #include <fcntl.h> 58 #endif 59 #if defined(__MWERKS__) || defined(THINK_C) || defined(applec) 60 #include <stdlib.h> 61 #define BSDTYPES 62 #endif 63 #ifdef _WINDOWS 64 #define BSDTYPES 65 #if !defined(WIN32) 66 #define SMALLPOINTERS 67 #endif 68 #endif 69 70 #ifdef isc 71 #define BSDTYPES 72 #endif 73 74 /* 75 * Workarounds for BSD lseek definitions. 76 */ 77 #if defined(SYSV) || defined(VMS) 78 #if defined(SYSV) 79 #include <unistd.h> 80 #endif 81 #define L_SET SEEK_SET 82 #define L_INCR SEEK_CUR 83 #define L_XTND SEEK_END 84 #endif /* defined(SYSV) || defined(VMS) */ 85 #ifndef L_SET 86 #define L_SET 0 87 #define L_INCR 1 88 #define L_XTND 2 89 #endif 90 91 /* 92 * The library uses memset, memcpy, and memcmp. 93 * ANSI C and System V define these in string.h. 94 */ 95 #include <string.h> 96 97 /* 98 * The BSD typedefs are used throughout the library. 99 * If your system doesn't have them in <sys/types.h>, 100 * then define BSDTYPES in your Makefile. 101 */ 102 #ifdef BSDTYPES 103 typedef unsigned char u_char; 104 typedef unsigned short u_short; 105 typedef unsigned int u_int; 106 typedef unsigned long u_long; 107 #endif 108 109 /* 110 * dblparam_t is the type that a double precision 111 * floating point value will have on the parameter 112 * stack (when coerced by the compiler). 113 */ 114 #ifdef applec 115 typedef extended dblparam_t; 116 #else 117 typedef double dblparam_t; 118 #endif 119 #endif /* _COMPAT_ */ 120