Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does GLib redefine types?

Tags:

c

types

glib

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

like image 214
Lucas Avatar asked Nov 30 '09 12:11

Lucas


1 Answers

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.

like image 142
Josh Lee Avatar answered Sep 21 '22 13:09

Josh Lee