Remove unnecessary SHERPA_ONNX_API from C/C++ APIs. - #3295
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on refining the C and C++ API headers by eliminating the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR removes the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR removes the SHERPA_ONNX_API export/import macro from a set of public C and C++ type declarations, keeping the macro usage focused on exported functions/classes rather than plain configuration/result structs.
Changes:
- Removed
SHERPA_ONNX_APIfrom multiple Ctypedef structdeclarations in the public C header. - Removed
SHERPA_ONNX_APIfrom several C++structdeclarations in the C++ API header.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sherpa-onnx/c-api/cxx-api.h | Drops SHERPA_ONNX_API from non-streaming C++ config/result structs. |
| sherpa-onnx/c-api/c-api.h | Drops SHERPA_ONNX_API from C typedef struct declarations and opaque forward typedefs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request removes the SHERPA_ONNX_API export macro from numerous C and C++ struct definitions across the public API headers (sherpa-onnx/c-api/c-api.h and sherpa-onnx/c-api/cxx-api.h). This change correctly targets data-only configuration and result structs, which do not need to be exported from a shared library, making the API surface cleaner. The API classes and functions that require exporting are unaffected. The changes are consistent and correct. No issues were found during this review.
Summary by CodeRabbit