$NetBSD: patch-ao,v 1.8 2022/04/24 21:50:48 tnn Exp $ --- hdf/src/hdfi.h.orig 2020-03-03 17:40:50.000000000 +0000 +++ hdf/src/hdfi.h @@ -95,6 +95,8 @@ * Define options for each platform *-------------------------------------------------------------------------*/ +#ifndef __NetBSD__ + /* * Meaning of each defined macros (not completed yet) * @@ -1115,6 +1117,71 @@ typedef long hdf_pint_t; #endif /* IA64 */ +#endif /* ! NetBSD */ + +#ifdef __NetBSD__ + +#ifdef GOT_MACHINE +If you get an error on this line more than one machine type has been defined. +Please check your Makefile. +#endif +#define GOT_MACHINE + +#include /* for unbuffered i/o stuff */ +#include +#ifdef __vax__ +#define DF_MT 0x2221 +#elif defined(__m68k__) || defined(__sparc__) || defined(__sparc64__) || defined(__powerpc__) +#define DF_MT 0x1111 +#else +#define DF_MT 0x4441 +#endif +typedef void VOID; +typedef void *VOIDP; +typedef char *_fcd; +typedef char char8; +typedef unsigned char uchar8; +typedef char int8; +typedef unsigned char uint8; +typedef short int int16; +typedef unsigned short int uint16; +#ifndef __rpc_types_h +typedef int int32; +typedef unsigned int uint32; +#endif /* __rpc_types_h */ +typedef int intn; +typedef unsigned int uintn; +typedef int intf; /* size of INTEGERs in Fortran compiler */ +typedef float float32; +typedef double float64; +#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__aarch64__) +typedef long hdf_pint_t; /* an integer the same size as a pointer */ +#else +typedef int hdf_pint_t; /* an integer the same size as a pointer */ +#endif +#define FNAME_POST_UNDERSCORE +#define _fcdtocp(desc) (desc) +#ifdef HAVE_FMPOOL +#define FILELIB PAGEBUFIO /* enable page buffering */ +#else +#define FILELIB UNIXBUFIO +#endif + +/* JPEG #define's - Look in the JPEG docs before changing - (Q) */ + +/* Determine the memory manager we are going to use. Valid values are: */ +/* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */ +/* what each does */ +#define JMEMSYS MEM_ANSI + +#ifdef __GNUC__ +#define HAVE_STDC +#define INCLUDES_ARE_ANSI +#endif + +#endif /* NetBSD */ + + #ifndef GOT_MACHINE No machine type has been defined. Your Makefile needs to have someing like -DSUN or -DUNICOS in order for the HDF internal structures to be defined