KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
kratos_export_api.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Carlos A. Roig Pina
11 //
12 
13 #ifndef KRATOS_EXPORT_API_H
14 #define KRATOS_EXPORT_API_H
15 
16 #undef KRATOS_API_EXPORT
17 #undef KRATOS_API_IMPORT
18 #if _WIN32
19  #if defined(__MINGW32__) || defined(__MINGW64__)
20  #define KRATOS_API_EXPORT __attribute__((visibility("default")))
21  #define KRATOS_API_IMPORT __attribute__((visibility("default")))
22  #else
23  #define KRATOS_API_EXPORT __declspec(dllexport)
24  #define KRATOS_API_IMPORT __declspec(dllimport)
25  #endif
26 #else
27  #define KRATOS_API_EXPORT __attribute__((visibility("default")))
28  #define KRATOS_API_IMPORT __attribute__((visibility("default")))
29 #endif
30 
31 // Fixes MSVC not expanding __VA_ARGS__ as defined in the C99 standard
32 #define KRATOS_EXPAND(A) A
33 
34 // Expands the API call to either import or export based on the
35 // number of the arguments in API() call.
36 #define KRATOS_API_CALL(x,T1,T2,T3,...) T3
37 
38 // If KRATOS_API_NO_DLL is defined ignore the DLL api
39 #ifndef KRATOS_API_NO_DLL
40  #define KRATOS_API(...) \
41  KRATOS_EXPAND(KRATOS_API_CALL(,##__VA_ARGS__,KRATOS_API_EXPORT,KRATOS_API_IMPORT))
42  #define KRATOS_NO_EXPORT(...)
43 #else
44  #define KRATOS_API(...)
45  #define KRATOS_NO_EXPORT(...)
46 #endif
47 
48 // Conditionally declare explicit template instances, since explicit instiation does not play nice with dllexport
49 #undef KRATOS_API_EXTERN
50 #ifdef _WIN32
51  #if defined(__MINGW32__) || defined(__MINGW64__)
52  #define KRATOS_API_EXTERN extern
53  #else
54  #define KRATOS_API_EXTERN
55  #endif
56 #else
57  #define KRATOS_API_EXTERN extern
58 #endif
59 
60 #endif