Matlab Coder 强制 boolean_T 为原生 C99 bool 类型

发布于 2025-01-15 09:19:25 字数 122 浏览 2 评论 0原文

如何强制 matlab 嵌入式编码器将“boolean_T”设置为“bool”C99 类型?

如果没有它,我需要 int->boolean_t 的显式转换 I/O 信号映射(int->bool 不需要)。

How can I force matlab embedded coder to set "boolean_T" as "bool" C99 type?

Without that, I need explicit cast conversion I/O signals mapping for int->boolean_t (not needed for int->bool).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对你而言 2025-01-22 09:19:25

将硬件切换到 Generic->MATLAB Host Computer 之外的其他硬件,您应该获得 C99 的 bool

cfg = coder.config('lib');
% Hit TAB to see other possible hardware or do
%   open cfg
% and use the GUI to pick one
cfg.HardwareImplementation.ProdHWDeviceType = 'Intel->x86-64 (Linux 64)';
codegen f -args true -config cfg -report -std:c99

使用 MATLAB Host Computer,boolean_T保留,以防引入某些 MATLAB 库以确保二进制兼容性。

Switch up the hardware to something other than Generic->MATLAB Host Computer and you should get bool for C99:

cfg = coder.config('lib');
% Hit TAB to see other possible hardware or do
%   open cfg
% and use the GUI to pick one
cfg.HardwareImplementation.ProdHWDeviceType = 'Intel->x86-64 (Linux 64)';
codegen f -args true -config cfg -report -std:c99

With MATLAB Host Computer, boolean_T is preserved in case some MATLAB libraries are pulled in to ensure binary compatibility.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文