Why does GLib redefine types?

大城市里の小女人 提交于 2019-12-17 19:49:07

问题


What is the reasoning behind types to be redefined in GLib? Why do they turn char into gchar, int into gint, etc.?


回答1:


Check out Basic Types in the GLib documentation. Essentially, it's to guarantee that certain types will exist with certain semantics, regardless of which C compiler or platform you're using. The types that C guarantees anyway are typedefed just to make all of the type names look uniform.



来源:https://stackoverflow.com/questions/1819561/why-does-glib-redefine-types

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!