This is needed to make it build with glib 2.31 and above.

Add support for 2.31 and above.
Only glib.h can be included directly.