onnxruntime
cbb74576 - Single-source OrtErrorCode values to keep StatusCode in sync (#29065)

Commit
23 days ago
Single-source OrtErrorCode values to keep StatusCode in sync (#29065) ### Description <!-- Describe your changes. --> Extract the public C API OrtErrorCode enum into its own header (onnxruntime_error_code.h) and define onnxruntime::common::StatusCode enumerators in terms of the ORT_* constants (e.g. OK = ORT_OK). This makes the public C API enum the single source of truth for error code values so the public and internal enums cannot drift out of sync, without requiring any call-site changes to the existing static_cast bridges. Add the new header to the C/C++ API install list (cmake/onnxruntime.cmake) and to the Doxygen INPUT list (docs/c_cxx/Doxyfile). ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> `OrtErrorCode` may be added to in the future. This change makes it easier to keep the internal enum in sync. Follow up to https://github.com/microsoft/onnxruntime/pull/29018#discussion_r3405250002 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Author
Parents
Loading