Mercurial > hg > sv-dependency-builds
comparison src/fftw-3.3.3/threads/f77api.c @ 10:37bf6b4a2645
Add FFTW3
author | Chris Cannam |
---|---|
date | Wed, 20 Mar 2013 15:35:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9:c0fb53affa76 | 10:37bf6b4a2645 |
---|---|
1 /* | |
2 * Copyright (c) 2003, 2007-11 Matteo Frigo | |
3 * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
7 * the Free Software Foundation; either version 2 of the License, or | |
8 * (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
18 * | |
19 */ | |
20 | |
21 #include "api.h" | |
22 | |
23 /* if F77_FUNC is not defined, then we don't know how to mangle identifiers | |
24 for the Fortran linker, and we must omit the f77 API. */ | |
25 #if defined(F77_FUNC) || defined(WINDOWS_F77_MANGLING) | |
26 | |
27 #include "x77.h" | |
28 | |
29 #define F77(a, A) F77x(x77(a), X77(A)) | |
30 | |
31 #ifndef WINDOWS_F77_MANGLING | |
32 | |
33 #if defined(F77_FUNC) | |
34 # define F77x(a, A) F77_FUNC(a, A) | |
35 # include "f77funcs.h" | |
36 #endif | |
37 | |
38 #if defined(F77_FUNC_) && !defined(F77_FUNC_EQUIV) | |
39 # undef F77x | |
40 # define F77x(a, A) F77_FUNC_(a, A) | |
41 # include "f77funcs.h" | |
42 #endif | |
43 | |
44 #else /* WINDOWS_F77_MANGLING */ | |
45 | |
46 /* Various mangling conventions common (?) under Windows. */ | |
47 | |
48 /* g77 */ | |
49 # define WINDOWS_F77_FUNC(a, A) a ## __ | |
50 # define F77x(a, A) WINDOWS_F77_FUNC(a, A) | |
51 # include "f77funcs.h" | |
52 | |
53 /* Intel, etc. */ | |
54 # undef WINDOWS_F77_FUNC | |
55 # define WINDOWS_F77_FUNC(a, A) a ## _ | |
56 # include "f77funcs.h" | |
57 | |
58 /* Digital/Compaq/HP Visual Fortran, Intel Fortran. stdcall attribute | |
59 is apparently required to adjust for calling conventions (callee | |
60 pops stack in stdcall). See also: | |
61 http://msdn.microsoft.com/library/en-us/vccore98/html/_core_mixed.2d.language_programming.3a_.overview.asp | |
62 */ | |
63 # undef WINDOWS_F77_FUNC | |
64 # if defined(__GNUC__) | |
65 # define WINDOWS_F77_FUNC(a, A) __attribute__((stdcall)) A | |
66 # elif defined(_MSC_VER) || defined(_ICC) || defined(_STDCALL_SUPPORTED) | |
67 # define WINDOWS_F77_FUNC(a, A) __stdcall A | |
68 # else | |
69 # define WINDOWS_F77_FUNC(a, A) A /* oh well */ | |
70 # endif | |
71 # include "f77funcs.h" | |
72 | |
73 #endif /* WINDOWS_F77_MANGLING */ | |
74 | |
75 #endif /* F77_FUNC */ |