题
在GLib中重新定义类型背后的原因是什么?为什么他们将char
转换为gchar
,int
转换为gint
等?
解决方案
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 typedef
ed just to make all of the type names look uniform.
不隶属于 StackOverflow