1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS.
12 #include "details/ie_no_copy.hpp"
14 #if defined(USE_STATIC_IE) || (defined(__GNUC__) && (__GNUC__ < 4))
15 #define INFERENCE_ENGINE_API(...) extern "C" __VA_ARGS__
16 #define INFERENCE_ENGINE_API_CPP(...) __VA_ARGS__
17 #define INFERENCE_ENGINE_API_CLASS(...) __VA_ARGS__
18 #define INFERENCE_ENGINE_CDECL __attribute__((cdecl))
21 #define INFERENCE_ENGINE_CDECL
23 #ifdef IMPLEMENT_INFERENCE_ENGINE_API
24 #define INFERENCE_ENGINE_API(...) extern "C" __declspec(dllexport) __VA_ARGS__ __cdecl
25 #define INFERENCE_ENGINE_API_CPP(...) __declspec(dllexport) __VA_ARGS__ __cdecl
26 #define INFERENCE_ENGINE_API_CLASS(...) __declspec(dllexport) __VA_ARGS__
28 #define INFERENCE_ENGINE_API(...) extern "C" __declspec(dllimport) __VA_ARGS__ __cdecl
29 #define INFERENCE_ENGINE_API_CPP(...) __declspec(dllimport) __VA_ARGS__ __cdecl
30 #define INFERENCE_ENGINE_API_CLASS(...) __declspec(dllimport) __VA_ARGS__
33 #define INFERENCE_ENGINE_CDECL __attribute__((cdecl))
34 #define INFERENCE_ENGINE_API(...) extern "C" __attribute__((visibility("default"))) __VA_ARGS__
35 #define INFERENCE_ENGINE_API_CPP(...) __attribute__((visibility("default"))) __VA_ARGS__
36 #define INFERENCE_ENGINE_API_CLASS(...) __attribute__((visibility("default"))) __VA_ARGS__
41 #define INFERENCE_ENGINE_DEPRECATED(msg) __declspec(deprecated(msg))
42 #elif defined __INTEL_COMPILER
43 #define INFERENCE_ENGINE_DEPRECATED(msg) __attribute__((deprecated(msg)))
44 #elif defined(__GNUC__)
45 #define INFERENCE_ENGINE_DEPRECATED(msg) __attribute__((deprecated((msg))))
47 #define INFERENCE_ENGINE_DEPRECATED(msg)
50 #define INFERENCE_ENGINE_NN_BUILDER_DEPRECATED \
51 INFERENCE_ENGINE_DEPRECATED("Use ngraph API. NN Builder API will be removed in 2020 R2")
52 #define INFERENCE_ENGINE_NN_BUILDER_API_CLASS(...) \
53 INFERENCE_ENGINE_NN_BUILDER_DEPRECATED \
54 INFERENCE_ENGINE_API_CLASS(__VA_ARGS__)
56 // Suppress warning "-Wdeprecated-declarations" / C4996
58 #define IE_DO_PRAGMA(x) __pragma(x)
59 #elif defined(__GNUC__)
60 #define IE_DO_PRAGMA(x) _Pragma(#x)
62 #define IE_DO_PRAGMA(x)
65 #if defined(_MSC_VER) && !defined(__clang__)
66 #define IE_SUPPRESS_DEPRECATED_START \
67 IE_DO_PRAGMA(warning(push)) \
68 IE_DO_PRAGMA(warning(disable : 4996))
69 #define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(warning(pop))
70 #elif defined(__INTEL_COMPILER)
71 #define IE_SUPPRESS_DEPRECATED_START \
72 IE_DO_PRAGMA(warning(push)) \
73 IE_DO_PRAGMA(warning(disable : 1478))
74 #define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(warning(pop))
75 #elif defined(__clang__) || ((__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ > 405))
76 #define IE_SUPPRESS_DEPRECATED_START \
77 IE_DO_PRAGMA(GCC diagnostic push) \
78 IE_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
79 #define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(GCC diagnostic pop)
81 #define IE_SUPPRESS_DEPRECATED_START
82 #define IE_SUPPRESS_DEPRECATED_END
85 #ifndef ENABLE_UNICODE_PATH_SUPPORT
87 #define ENABLE_UNICODE_PATH_SUPPORT
88 #elif defined(__GNUC__) && (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)) || defined(__clang__)
89 #define ENABLE_UNICODE_PATH_SUPPORT