ie_api.h
Go to the documentation of this file.
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS.
7  * @file ie_api.h
8  */
9 #pragma once
10 
11 #include "details/ie_no_copy.hpp"
12 
13 #if defined(USE_STATIC_IE) || ( defined(__GNUC__) && (__GNUC__ < 4) )
14  #define INFERENCE_ENGINE_API(TYPE) extern "C" TYPE
15  #define INFERENCE_ENGINE_API_CPP(type) type
16  #define INFERENCE_ENGINE_API_CLASS(type) type
17  #define INFERENCE_ENGINE_CDECL __attribute__((cdecl))
18 #else
19  #if defined(_WIN32)
20  #define INFERENCE_ENGINE_CDECL
21  #ifdef IMPLEMENT_INFERENCE_ENGINE_API
22  #define INFERENCE_ENGINE_API(type) extern "C" __declspec(dllexport) type __cdecl
23  #define INFERENCE_ENGINE_API_CPP(type) __declspec(dllexport) type __cdecl
24  #define INFERENCE_ENGINE_API_CLASS(type) __declspec(dllexport) type
25  #else
26  #define INFERENCE_ENGINE_API(type) extern "C" __declspec(dllimport) type __cdecl
27  #define INFERENCE_ENGINE_API_CPP(type) __declspec(dllimport) type __cdecl
28  #define INFERENCE_ENGINE_API_CLASS(type) __declspec(dllimport) type
29  #endif
30  #else
31  #define INFERENCE_ENGINE_CDECL __attribute__((cdecl))
32  #ifdef IMPLEMENT_INFERENCE_ENGINE_API
33  #define INFERENCE_ENGINE_API(type) extern "C" __attribute__((visibility("default"))) type
34  #define INFERENCE_ENGINE_API_CPP(type) __attribute__((visibility("default"))) type
35  #define INFERENCE_ENGINE_API_CLASS(type) __attribute__((visibility("default"))) type
36  #else
37  #define INFERENCE_ENGINE_API(type) extern "C" type
38  #define INFERENCE_ENGINE_API_CPP(type) type
39  #define INFERENCE_ENGINE_API_CLASS(type) type
40  #endif
41  #endif
42 #endif
header file for no_copy class