Provide g_utf8_make_valid if not available

See #3415 for licensing discussion.

Fixes Airblader/i3#236
This commit is contained in:
Orestis Floros
2018-09-21 01:50:51 +03:00
parent aa8215194c
commit daf5ca111f
3 changed files with 99 additions and 0 deletions

View File

@ -320,6 +320,11 @@ int ipc_recv_message(int sockfd, uint32_t *message_type,
*/
void fake_configure_notify(xcb_connection_t *conn, xcb_rectangle_t r, xcb_window_t window, int border_width);
#define HAS_G_UTF8_MAKE_VALID GLIB_CHECK_VERSION(2, 52, 0)
#if !HAS_G_UTF8_MAKE_VALID
gchar *g_utf8_make_valid(const gchar *str, gssize len);
#endif
/**
* Returns the colorpixel to use for the given hex color (think of HTML). Only
* works for true-color (vast majority of cases) at the moment, avoiding a