| 1 |
/*! \file DebugUtils.hpp |
| 2 |
\brief compatibility of compilers |
| 3 |
\author Xavier Juvigny, ONERA |
| 4 |
\date Jan. 12th 2005 |
| 5 |
\date Nov. 30th 2016 |
| 6 |
*/ |
| 7 |
|
| 8 |
// This file is part of Dissection |
| 9 |
// |
| 10 |
// Dissection is free software: you can redistribute it and/or modify |
| 11 |
// it under the terms of the GNU General Public License as published by |
| 12 |
// the Free Software Foundation, either version 3 of the License, or |
| 13 |
// (at your option) any later version. |
| 14 |
// |
| 15 |
// Linking Dissection statically or dynamically with other modules is making |
| 16 |
// a combined work based on Disssection. Thus, the terms and conditions of |
| 17 |
// the GNU General Public License cover the whole combination. |
| 18 |
// |
| 19 |
// As a special exception, the copyright holders of Dissection give you |
| 20 |
// permission to combine Dissection program with free software programs or |
| 21 |
// libraries that are released under the GNU LGPL and with independent modules |
| 22 |
// that communicate with Dissection solely through the Dissection-fortran |
| 23 |
// interface. You may copy and distribute such a system following the terms of |
| 24 |
// the GNU GPL for Dissection and the licenses of the other code concerned, |
| 25 |
// provided that you include the source code of that other code when and as |
| 26 |
// the GNU GPL requires distribution of source code and provided that you do |
| 27 |
// not modify the Dissection-fortran interface. |
| 28 |
// |
| 29 |
// Note that people who make modified versions of Dissection are not obligated |
| 30 |
// to grant this special exception for their modified versions; it is their |
| 31 |
// choice whether to do so. The GNU General Public License gives permission to |
| 32 |
// release a modified version without this exception; this exception also makes |
| 33 |
// it possible to release a modified version which carries forward this |
| 34 |
// exception. If you modify the Dissection-fortran interface, this exception |
| 35 |
// does not apply to your modified version of Dissection, and you must remove |
| 36 |
// this exception when you distribute your modified version. |
| 37 |
// |
| 38 |
// This exception is an additional permission under section 7 of the GNU |
| 39 |
// General Public License, version 3 ("GPLv3") |
| 40 |
// |
| 41 |
// Dissection is distributed in the hope that it will be useful, |
| 42 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 43 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 44 |
// GNU General Public License for more details. |
| 45 |
// |
| 46 |
// You should have received a copy of the GNU General Public License |
| 47 |
// along with Dissection. If not, see <http://www.gnu.org/licenses/>. |
| 48 |
// |
| 49 |
|
| 50 |
#ifndef _COMPILER_OPTIONCOMPILER_H |
| 51 |
# define _COMPILER_OPTIONCOMPILER_H |
| 52 |
|
| 53 |
// ========= Append a underscore or not for Fortran subroutines ======== |
| 54 |
#ifdef WIN32 |
| 55 |
# ifdef NB_NO_UNDERSCORE |
| 56 |
# define FORTRAN_DECL_WL(x_windows,x_linux) x_windows |
| 57 |
# else |
| 58 |
# ifdef NB_DBLEUNDERSCORE |
| 59 |
# define FORTRAN_DECL_WL(x_windows,x_linux) x_windows##__ |
| 60 |
# else |
| 61 |
# define FORTRAN_DECL_WL(x_windows,x_linux) x_windows##_ |
| 62 |
# endif |
| 63 |
# endif |
| 64 |
#else |
| 65 |
# ifdef NB_NO_UNDERSCORE |
| 66 |
# define FORTRAN_DECL_WL(x_windows,x_linux) x_linux |
| 67 |
# else |
| 68 |
# ifdef NB_DBLEUNDERSCORE |
| 69 |
# define FORTRAN_DECL_WL(x_windows,x_linux) x_linux##__ |
| 70 |
# else |
| 71 |
# define FORTRAN_DECL_WL(x_windows,x_linux) x_linux##_ |
| 72 |
# endif |
| 73 |
# endif |
| 74 |
#endif |
| 75 |
|
| 76 |
# ifdef NB_NO_UNDERSCORE |
| 77 |
# define FORTRAN_DECL(x) x |
| 78 |
# else |
| 79 |
# ifdef NB_DBLEUNDERSCORE |
| 80 |
# define FORTRAN_DECL(x) x##__ |
| 81 |
# else |
| 82 |
# define FORTRAN_DECL(x) x##_ |
| 83 |
# endif |
| 84 |
# endif |
| 85 |
|
| 86 |
#ifdef _MSC_VER |
| 87 |
# ifdef _DLL |
| 88 |
# ifdef DISSECTION_EXPORTS // when building DLL |
| 89 |
# define DISSECTION_API __declspec(dllexport) |
| 90 |
# else // when client uses DLL |
| 91 |
# define DISSECTION_API __declspec(dllimport) |
| 92 |
# endif |
| 93 |
# else |
| 94 |
# define DISSECTION_API |
| 95 |
# endif |
| 96 |
#else |
| 97 |
# define DISSECTION_API |
| 98 |
#endif |
| 99 |
|
| 100 |
#endif |