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