为什么每个人都对标准C类型进行定义? [英] Why does everybody typedef over standard C types?

查看:94
本文介绍了为什么每个人都对标准C类型进行定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您想使用 Qt ,则必须使用 quint8 quint16 等。

If you want to use Qt, you have to embrace quint8, quint16 and so forth.

如果要使用 GLib ,您必须欢迎 guint8 guint16 等等。

Linux u32 s16 等。

uC / OS 定义 SINT32 UINT16 等。

如果您必须结合使用这些东西,则最好为遇到麻烦做好准备。因为在您的计算机上, u32 将是 typedef d超过 long quint32 将是 typedef d int 和编译器会抱怨

And if you have to use some combination of those things, you better be prepared for trouble. Because on your machine u32 will be typedefd over long and quint32 will be typedefd over int and the compiler will complain.

如果存在< stdint.h>

推荐答案

stdint.h 在开发这些库时还不存在。因此,每个库都有自己的 typedef s。

stdint.h didn't exist back when these libraries were being developed. So each library made its own typedefs.

这篇关于为什么每个人都对标准C类型进行定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆