301f3d5ea5ed93b7020d65bb93150b185fb9c2be
[alexxy/gromacs.git] / include / callf77.h
1 /*
2  * $Id$
3  * 
4  *       This source code is part of
5  * 
6  *        G   R   O   M   A   C   S
7  * 
8  * GROningen MAchine for Chemical Simulations
9  * 
10  *               VERSION 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
17  * GROMACS: A message-passing parallel molecular dynamics implementation
18  * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19  * Comp. Phys. Comm. 91, 43-56 (1995)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Good ROcking Metal Altar for Chronical Sinners
28  */
29
30 #ifndef _callf77_h
31 #define _callf77_h
32
33 static char *SRCID_callf77_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #ifdef USE_FORTRAN
40
41 #define FUNC(name,NAME) F77_FUNC(name,NAME)
42 #define SCALARG(name) *name
43 #define SCAL(name) &(name)
44
45 /* define f77 name mangling - we dont need any
46  * special macros for names with underscores since
47  * no such identifiers exist in gromacs right now.
48  * If you add one you should include the definition
49  * of F77_NAME_EXTRA_UNDERSCORE below and create
50  * the macro F77_FUNC_(name,NAME).
51  */
52 #ifdef F77_NAME_LOWERCASE
53 #  define F77_FUNC(name,NAME)     name
54 #  ifdef F77_NAME_EXTRA_UNDERSCORE
55 #    define F77_FUNC_(name,NAME)  name ## _
56 #  else
57 #    define F77_FUNC_(name,NAME)  name
58 #  endif
59 #elif defined F77_NAME_LOWERCASE_UNDERSCORE
60 #  define F77_FUNC(name,NAME)     name ## _
61 #  ifdef F77_NAME_EXTRA_UNDERSCORE
62 #    define F77_FUNC_(name,NAME)  name ## __
63 #  else
64 #    define F77_FUNC_(name,NAME)  name ## _
65 #  endif
66 #elif defined F77_NAME_UPPERCASE
67 #  define F77_FUNC(name,NAME)     NAME
68 #  ifdef F77_NAME_EXTRA_UNDERSCORE
69 #    define F77_FUNC_(name,NAME)  NAME ## _
70 #  else
71 #    define F77_FUNC_(name,NAME)  NAME
72 #  endif
73 #elif defined F77_NAME_UPPERCASE_UNDERSCORE
74 #  define F77_FUNC(name,NAME)     NAME ## _
75 #  ifdef F77_NAME_EXTRA_UNDERSCORE
76 #    define F77_FUNC_(name,NAME)  NAME ## __
77 #  else
78 #    define F77_FUNC_(name,NAME)  NAME ## _
79 #  endif
80 #endif
81
82 #else /* Use C */
83
84 #define FUNC(name,NAME) name
85 #define SCALARG(name) name
86 #define SCAL(name) name
87
88 #endif
89
90 #endif