diff --git a/panels/printers/pp-cups.c b/panels/printers/pp-cups.c index b6692ede2..6521b90ba 100644 --- a/panels/printers/pp-cups.c +++ b/panels/printers/pp-cups.c @@ -20,6 +20,15 @@ #include "pp-cups.h" +#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) +#define HAVE_CUPS_1_6 1 +#endif + +#ifndef HAVE_CUPS_1_6 +#define ippGetInteger(attr, element) attr->values[element].integer +#define ippGetStatusCode(ipp) ipp->request.status.status_code +#endif + G_DEFINE_TYPE (PpCups, pp_cups, G_TYPE_OBJECT); static void diff --git a/panels/printers/pp-job.c b/panels/printers/pp-job.c index 0c7c26781..730776064 100644 --- a/panels/printers/pp-job.c +++ b/panels/printers/pp-job.c @@ -23,6 +23,26 @@ #include #include +#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) +#define HAVE_CUPS_1_6 1 +#endif + +#ifndef HAVE_CUPS_1_6 +#define ippGetBoolean(attr, element) attr->values[element].boolean +#define ippGetCount(attr) attr->num_values +#define ippGetInteger(attr, element) attr->values[element].integer +#define ippGetString(attr, element, language) attr->values[element].string.text +#define ippGetValueTag(attr) attr->value_tag +static int +ippGetRange (ipp_attribute_t *attr, + int element, + int *upper) +{ + *upper = attr->values[element].range.upper; + return (attr->values[element].range.lower); +} +#endif + typedef struct { GObject parent;