Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 2004 18:37:19 +0100
From:      Adriaan de Groot <adridg@cs.kun.nl>
To:        mi@aldan.algebra.com
Cc:        freebsd-amd64@freebsd.org
Subject:   [PATCH] hdf on amd64
Message-ID:  <200402061837.19872.adridg@cs.kun.nl>

next in thread | raw e-mail | index | archive | help

--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 <groot@kde.org>
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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+#ifdef __WATCOMC__
+#include <stddef.h>         /* 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402061837.19872.adridg>