已合并
【PR】: add error manager C callback wrappers #858
KenChow创建于 3月13日
【PR】: add error manager C callback wrappers #858
已合并
KenChow创建于 3月13日
共 3 个文件变更+251-0
Msrc/dfx/error_manager/error_manager.cc+76-0文件内容审核中,请稍后刷新重试
@@ -282,4 +282,65 @@ class ErrorManager {
282 std::vector<ErrorItem> error_message_process_; // 进程粒度,所有的errmsg存到同一个vector282 std::vector<ErrorItem> error_message_process_; // 进程粒度,所有的errmsg存到同一个vector
283 std::vector<ErrorItem> warning_messages_process_; // 进程粒度,所有的warning msg存到同一个vector283 std::vector<ErrorItem> warning_messages_process_; // 进程粒度,所有的warning msg存到同一个vector
284};284};
285+ 
286+#ifdef __cplusplus
287+extern "C" {
288+#endif
289+ 
290+#if defined(__GNUC__)
291+#ifndef GE_FUNC_HOST_VISIBILITY
292+#if defined(HOST_VISIBILITY)
293+#define GE_FUNC_HOST_VISIBILITY __attribute__((visibility("default")))
294+#else
295+#define GE_FUNC_HOST_VISIBILITY
296+#endif
297+#endif // GE_FUNC_HOST_VISIBILITY
298+ 
299+#ifndef GE_FUNC_DEV_VISIBILITY
300+#if defined(DEV_VISIBILITY)
301+#define GE_FUNC_DEV_VISIBILITY __attribute__((visibility("default")))
302+#else
303+#define GE_FUNC_DEV_VISIBILITY
304+#endif
305+#endif // GE_FUNC_DEV_VISIBILITY
306+ 
307+#ifndef FORMAT_PRINTF
308+#define FORMAT_PRINTF(format_idx, first_arg) __attribute__((format(printf, (format_idx), (first_arg))))
309+#endif
310+ 
311+#else
312+#ifndef GE_FUNC_HOST_VISIBILITY
313+#define GE_FUNC_HOST_VISIBILITY
314+#endif
315+ 
316+#ifndef GE_FUNC_DEV_VISIBILITY
317+#define GE_FUNC_DEV_VISIBILITY
318+#endif
319+ 
320+#ifndef FORMAT_PRINTF
321+#define FORMAT_PRINTF(format_idx, first_arg)
322+#endif
323+#endif
324+ 
325+ 
326+GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY
327+int32_t RegisterFormatErrorMessageForC(const char *error_msg, unsigned long error_msg_len);
328+ 
329+GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY
330+int32_t ReportPredefinedErrMsgForC(const char *error_code, const char **key, const char **value, unsigned long arg_num);
331+ 
332+#ifdef __GNUC__
333+GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY
334+int32_t ReportInnerErrMsgForC(const char *file_name, const char *func, uint32_t line,
335+ const char *error_code, const char *format, ...) FORMAT_PRINTF(5, 6);
336+#else
337+GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY
338+int32_t ReportInnerErrMsgForC(const char *file_name, const char *func, uint32_t line,
339+ const char *error_code, const char *format, ...);
340+#endif
341+ 
342+#ifdef __cplusplus
343+}
344+#endif
345+ 
285#endif // ERROR_MANAGER_H_346#endif // ERROR_MANAGER_H_
Mtests/ut/error_manager/testcase/error_manager_unittest.cc+114-0文件内容审核中,请稍后刷新重试