From owner-freebsd-amd64@FreeBSD.ORG Fri Feb 6 09:38:27 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD10716A4CE; Fri, 6 Feb 2004 09:38:27 -0800 (PST) Received: from pandora.cs.kun.nl (pandora.cs.kun.nl [131.174.33.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10E2643D5E; Fri, 6 Feb 2004 09:37:56 -0800 (PST) (envelope-from adridg@cs.kun.nl) Received: from odin.cs.kun.nl [131.174.33.33] (helo=localhost) by pandora.cs.kun.nl (8.12.10/3.61) with ESMTP id i16HbJRv013787; Fri, 6 Feb 2004 18:37:20 +0100 (MET) From: Adriaan de Groot To: mi@aldan.algebra.com Date: Fri, 6 Feb 2004 18:37:19 +0100 User-Agent: KMail/1.6.50 MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_PD9IAjTlIs4mx8B" Message-Id: <200402061837.19872.adridg@cs.kun.nl> cc: kde@freebsd.org cc: freebsd-amd64@freebsd.org Subject: [PATCH] hdf on amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2004 17:38:28 -0000 --Boundary-00=_PD9IAjTlIs4mx8B Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [CC to the amd64 list because it's particular to that platform; CC to KDE=20 because it's a dependency for their ports, which prevents the ports from=20 building on amd64.] The attached patch adds support for the amd64 platform by introducing a new= =20 machine definition. I hope I got it all right - in particular, the code=20 assumes that a fortran int can be cast to a pointer, so I _must_ define the= =20 fortran int as long. I haven't checked if that is really the case, so while= =20 the port may build now, it might not actually work. The patch also augments the totally bogus #if some-error-condition Regular english text explaining the error. #endif (which gets you grand error messages from gcc like "Syntax error near "you"= =2E")=20 by the slightly less bogus #if some-error-condition #ifdef __GNUC__ #error English text #else Regular english text #endif #endif It doesn't do so across all the platforms, though, so it could use some=20 augmentation itself. =2D --=20 pub 1024D/FEA2A3FE 2002-06-18 Adriaan de Groot The users that I support would double-click on a landmine to see what it di= d. =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAI9DPdqzuAf6io/4RAh+cAJ4kBHZ/zxOET/jjjNlp3zXH9s692QCZASh1 ag4EUe15JFxXz7rBhPG+uXk=3D =3D2U4b =2D----END PGP SIGNATURE----- --Boundary-00=_PD9IAjTlIs4mx8B Content-Type: text/x-diff; charset="us-ascii"; name="hdf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="hdf.patch" --- hdf/src/hdfi.h.orig Fri Feb 6 09:59:27 2004 +++ hdf/src/hdfi.h Fri Feb 6 14:36:06 2004 @@ -826,6 +826,71 @@ #endif /*MAC*/ +#if defined(__amd64__) && defined(__FreeBSD__) + + +#ifdef GOT_MACHINE +#ifdef __GNUC__ +#error More than one machine type defined. +#else +If you get an error on this line more than one machine type has been defined. +Please check your Makefile. +#endif +#endif +#define GOT_MACHINE 1 + +#include +#include /* for unbuffered file I/O */ +#include +#include +#include /* for character macros */ +#ifdef __WATCOMC__ +#include /* for the 'fortran' pragma */ +#endif + +#define DF_MT DFMT_PC + +#ifndef VOID /* The stupid windows.h header file uses a #define instead of a typedef */ +typedef void VOID; +#endif /* end 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; +typedef int int32; +typedef unsigned int uint32; +typedef int intn; +typedef unsigned int uintn; +typedef float float32; +typedef double float64; +typedef long intf; /* size of INTEGERs in Fortran compiler */ +typedef long hdf_pint_t; /* an integer the same size as a pointer */ + +#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 +#define HAVE_STDC +#define INCLUDES_ARE_ANSI + +#endif + + /* Metrowerks Mac compiler defines some PC stuff so need to exclude this on the Mac */ #if !(defined(macintosh) || defined(MAC)) @@ -851,8 +916,12 @@ #endif /* WIN386 | DOS386 | UNIX386 */ #ifdef GOT_MACHINE +#ifdef __GNUC__ +#error More than one machine type has been defined. +#else If you get an error on this line more than one machine type has been defined. Please check your Makefile. +#endif #endif #define GOT_MACHINE 1 --Boundary-00=_PD9IAjTlIs4mx8B--