Ie capi callback with explicit calling convention (#697)
authoremmanuelattia-philips <66060489+emmanuelattia-philips@users.noreply.github.com>
Sun, 31 May 2020 20:19:37 +0000 (22:19 +0200)
committerGitHub <noreply@github.com>
Sun, 31 May 2020 20:19:37 +0000 (23:19 +0300)
* Added explicit calling convention to CAPI callback

* Fixed typo spacing

* Renamed INFERENCE_ENGINE_CALLBACK to INFERENCE_ENGINE_C_API_CALLBAC to make the macro really specific to the C API

inference-engine/ie_bridges/c/include/c_api/ie_c_api.h

index 4299639..f124978 100644 (file)
@@ -31,6 +31,7 @@
     #define IE_NODISCARD
 #else
     #if defined(_WIN32)
+        #define INFERENCE_ENGINE_C_API_CALLBACK __cdecl
         #ifdef inference_engine_c_api_EXPORTS
             #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN   __declspec(dllexport) __VA_ARGS__ __cdecl
         #else
     #endif
 #endif
 
+#ifndef INFERENCE_ENGINE_C_API_CALLBACK
+#define INFERENCE_ENGINE_C_API_CALLBACK
+#endif
+
 typedef struct ie_core ie_core_t;
 typedef struct ie_network ie_network_t;
 typedef struct ie_executable ie_executable_network_t;
@@ -284,7 +289,7 @@ typedef struct ie_blob_buffer {
  * @brief Completion callback definition about the function and args
  */
 typedef struct ie_complete_call_back {
-    void (*completeCallBackFunc)(void *args);
+    void (INFERENCE_ENGINE_C_API_CALLBACK *completeCallBackFunc)(void *args);
     void *args;
 }ie_complete_call_back_t;