/** * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. */ #ifndef GE_EXECUTOR_C_BASE_H #define GE_EXECUTOR_C_BASE_H #include #include #include #if defined(__cplusplus) extern "C" { #endif #define SUCCESS 0 typedef void (*FnDestroy)(void *); #define MEMBER_OFFSET(mainType, memberName) ((uintptr_t)(void *)(&(((mainType *)0)->memberName))) #define GET_MAIN_BY_MEMBER(memberAddr, mainType, memberName) \ ((mainType *)(void *)((uintptr_t)(void *)(memberAddr)-MEMBER_OFFSET(mainType, memberName))) #if defined(__cplusplus) } #endif #endif // GE_EXECUTOR_C_BASE_H