Allow building against glib 2.31 and later

This commit is contained in:
Thierry Reding 2012-02-23 09:13:22 +01:00 committed by Yann Diorcet
parent 161e8252ad
commit d1d6ab83af
2 changed files with 8 additions and 0 deletions

View file

@ -1643,7 +1643,9 @@ int main(int argc, char *argv[]){
GdkPixbuf *pbuf;
const char *app_name="Linphone";
#if !GLIB_CHECK_VERSION(2, 31, 0)
g_thread_init(NULL);
#endif
gdk_threads_init();
progpath = strdup(argv[0]);

View file

@ -270,7 +270,11 @@ static void account_username_changed(GtkEntry *entry, GtkWidget *w) {
linphone_account_creator_set_username(creator, gtk_entry_get_text(username));
if (g_regex_match_simple("^[a-zA-Z]+[a-zA-Z0-9.\\-_]{3,}$", gtk_entry_get_text(username), 0, 0)) {
#if !GLIB_CHECK_VERSION(2, 31, 0)
g_thread_create(check_username_availability, (void*)w, FALSE, NULL);
#else
g_thread_new(NULL, check_username_availability, w);
#endif
}
else {
if (gtk_entry_get_text_length(username) < LOGIN_MIN_SIZE) {
@ -534,7 +538,9 @@ GtkWidget * linphone_gtk_create_assistant(void){
ok = create_pixbuf(linphone_gtk_get_ui_config("ok","ok.png"));
notok = create_pixbuf(linphone_gtk_get_ui_config("notok","notok.png"));
#if !GLIB_CHECK_VERSION(2, 31, 0)
g_thread_init (NULL);
#endif
gdk_threads_init ();
GtkWidget *p1=create_intro();