prefix=$ac_default_prefix
fi
if test "x$enable-maintainer-mode" = "x"; then
- CFLAGS="-g -Wall -O -O2 -Wno-unused-variable -Wno-uninitialized -Wno-deprecated"
+ CFLAGS="-g -Wall -O -O2 -Wno-unused-variable -Wno-uninitialized"
else
- CFLAGS="-g -Wno-deprecated -Wall"
+ CFLAGS="-g -Wall"
fi
BINDIR="${prefix}/bin"
AC_DEFINE_UNQUOTED(BINDIR, "$BINDIR", [Where is binary installed])
}
static void email_ptr_foreach(gpointer data, gpointer user_data) {
+#if GLIB_CHECK_VERSION(2,32,0)
+ GArray* email = g_array_sized_new(FALSE, FALSE, sizeof(GValue), sizeof(data));
+#else
GValueArray* email = (GValueArray *) data;
+#endif
GValue* email_member;
guint i, j;
Contact* contact = (Contact *) user_data;
Email* mail;
+#if GLIB_CHECK_VERSION(2,32,0)
+ if (! email || ! contact || email->len < 1)
+#else
if (! email || ! contact || email->n_values < 1)
+#endif
return;
mail = g_new0(Email, 1);
+#if GLIB_CHECK_VERSION(2,32,0)
+ for (i = j = 0; i < email->len; j++, i++) {
+#else
for (i = j = 0; i < email->n_values; j++, i++) {
+#endif
if (j > 0 && j % 3 == 0) {
mail = g_new0(Email, 1);
contact->emails = g_slist_prepend(contact->emails, mail);
j = 0;
}
+#if GLIB_CHECK_VERSION(2,32,0)
+ email_member = &g_array_index(email, GValue, i);
+#else
email_member = g_value_array_get_nth(email, i);
+#endif
switch (j) {
case 0:
mail->alias = g_value_dup_string(email_member);
* address where every string is empty (empty as in "" and not NULL)
*/
static GPtrArray* get_email_list(GPtrArray* list) {
- GValueArray* email;
+#if GLIB_CHECK_VERSION(2,32,0)
+ GArray* email = g_array_sized_new(FALSE, FALSE, sizeof(GValue), 1);
+#else
+ GValueArray* email;
+#endif
GValue* item;
guint i;
gboolean found = FALSE;
return list;
email = g_ptr_array_index(list, 0);
+#if GLIB_CHECK_VERSION(2,32,0)
+ for (i = 0; !found && i < email->len; i++) {
+ item = &g_array_index(email, GValue, i);
+#else
for (i = 0; !found && i < email->n_values; i++) {
item = g_value_array_get_nth(email, i);
+#endif
gchar* str = (gchar *) g_value_get_string(item);
if (str && strlen(str) > 0)
found = TRUE;
}
void g_value_email_free(gpointer data) {
+#if GLIB_CHECK_VERSION(2,32,0)
+ GArray* email = g_array_sized_new(FALSE, FALSE, sizeof(GValue), sizeof(data));
+#else
GValueArray* email = (GValueArray *) data;
+#endif
GValue* email_member;
guint i;
if (! email)
return;
+#if GLIB_CHECK_VERSION(2,32,0)
+ for (i = 0; i < email->len; i++) {
+ email_member = &g_array_index(email, GValue, i);
+#else
for (i = 0; i < email->n_values; i++) {
email_member = g_value_array_get_nth(email, i);
+#endif
g_value_unset(email_member);
}
}
}
static void email_ptr_foreach(gpointer data, gpointer user_data) {
+#if GLIB_CHECK_VERSION(2,32,0)
+ GArray* email = g_array_sized_new(FALSE, FALSE, sizeof(GValue), sizeof(data));
+#else
GValueArray* email = (GValueArray *) data;
+#endif
GValue* email_member;
guint i, j;
FILE* f = (FILE *) user_data;
gchar* text = NULL;
+#if GLIB_CHECK_VERSION(2,32,0)
+ for (i = j = 0; email && i < email->len; j++, i++) {
+#else
for (i = j = 0; email && i < email->n_values; j++, i++) {
+#endif
if (j > 0 && j % 3 == 0) {
if (f)
fprintf(f, "---------------------------------------------\n");
g_message("---------------------------------------------\n");
j = 0;
}
+#if GLIB_CHECK_VERSION(2,32,0)
+ email_member = &g_array_index(email, GValue, i);
+#else
email_member = g_value_array_get_nth(email, i);
+#endif
switch (j) {
case 0:
text = g_strdup_printf("Alias: %s\n", g_value_get_string(email_member));