Fix build with old cups
svn path=/trunk/; revision=21079
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2008-08-11 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Bug 546616 – CUPS print backend uses 1.2 API without guards
|
||||||
|
|
||||||
|
* modules/printbackends/cups/gtkcupsutils.[hc]: Make use
|
||||||
|
of cups 1.2 api dependent on the HAVE_CUPS_1_2 define.
|
||||||
|
Patch by Sven Herzberg and Richard Hult
|
||||||
|
|
||||||
2008-08-11 Michael Natterer <mitch@imendio.com>
|
2008-08-11 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
Bug 547270 – Make GtkHSV public
|
Bug 547270 – Make GtkHSV public
|
||||||
|
|||||||
@ -1204,6 +1204,7 @@ GtkCupsConnectionTest *
|
|||||||
gtk_cups_connection_test_new (const char *server)
|
gtk_cups_connection_test_new (const char *server)
|
||||||
{
|
{
|
||||||
GtkCupsConnectionTest *result = NULL;
|
GtkCupsConnectionTest *result = NULL;
|
||||||
|
#ifdef HAVE_CUPS_API_1_2
|
||||||
gchar *port_str = NULL;
|
gchar *port_str = NULL;
|
||||||
|
|
||||||
result = g_new (GtkCupsConnectionTest, 1);
|
result = g_new (GtkCupsConnectionTest, 1);
|
||||||
@ -1222,6 +1223,9 @@ gtk_cups_connection_test_new (const char *server)
|
|||||||
result->success_at_init = FALSE;
|
result->success_at_init = FALSE;
|
||||||
|
|
||||||
result->success_at_init = gtk_cups_connection_test_is_server_available (result);
|
result->success_at_init = gtk_cups_connection_test_is_server_available (result);
|
||||||
|
#else
|
||||||
|
result = g_new (GtkCupsConnectionTest, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1235,6 +1239,7 @@ gtk_cups_connection_test_new (const char *server)
|
|||||||
gboolean
|
gboolean
|
||||||
gtk_cups_connection_test_is_server_available (GtkCupsConnectionTest *test)
|
gtk_cups_connection_test_is_server_available (GtkCupsConnectionTest *test)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_CUPS_API_1_2
|
||||||
http_addrlist_t *iter;
|
http_addrlist_t *iter;
|
||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
gint flags;
|
gint flags;
|
||||||
@ -1295,6 +1300,9 @@ gtk_cups_connection_test_is_server_available (GtkCupsConnectionTest *test)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function frees memory used by the GtkCupsConnectionTest structure.
|
/* This function frees memory used by the GtkCupsConnectionTest structure.
|
||||||
@ -1305,6 +1313,7 @@ gtk_cups_connection_test_free (GtkCupsConnectionTest *test)
|
|||||||
if (test == NULL)
|
if (test == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef HAVE_CUPS_API_1_2
|
||||||
test->current_addr = NULL;
|
test->current_addr = NULL;
|
||||||
httpAddrFreeList (test->addrlist);
|
httpAddrFreeList (test->addrlist);
|
||||||
if (test->socket != -1)
|
if (test->socket != -1)
|
||||||
@ -1312,5 +1321,6 @@ gtk_cups_connection_test_free (GtkCupsConnectionTest *test)
|
|||||||
close (test->socket);
|
close (test->socket);
|
||||||
test->socket = -1;
|
test->socket = -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
g_free (test);
|
g_free (test);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,10 +83,12 @@ struct _GtkCupsRequest
|
|||||||
|
|
||||||
struct _GtkCupsConnectionTest
|
struct _GtkCupsConnectionTest
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_CUPS_API_1_2
|
||||||
http_addrlist_t *addrlist;
|
http_addrlist_t *addrlist;
|
||||||
http_addrlist_t *current_addr;
|
http_addrlist_t *current_addr;
|
||||||
gboolean success_at_init;
|
gboolean success_at_init;
|
||||||
gint socket;
|
gint socket;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GTK_CUPS_REQUEST_START 0
|
#define GTK_CUPS_REQUEST_START 0
|
||||||
|
|||||||
Reference in New Issue
Block a user