From owner-svn-ports-all@FreeBSD.ORG Fri Jun 6 10:32:29 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0D41175; Fri, 6 Jun 2014 10:32:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 944BF2047; Fri, 6 Jun 2014 10:32:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56AWTxW056377; Fri, 6 Jun 2014 10:32:29 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56AWT2i056376; Fri, 6 Jun 2014 10:32:29 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201406061032.s56AWT2i056376@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 6 Jun 2014 10:32:29 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r356761 - head/graphics/epdfview/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 10:32:29 -0000 Author: bapt Date: Fri Jun 6 10:32:29 2014 New Revision: 356761 URL: http://svnweb.freebsd.org/changeset/ports/356761 QAT: https://qat.redports.org/buildarchive/r356761/ Log: Fix build with recent cups Reported by: "Herbert J. Skuhra" Added: head/graphics/epdfview/files/patch-cups (contents, props changed) Added: head/graphics/epdfview/files/patch-cups ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/epdfview/files/patch-cups Fri Jun 6 10:32:29 2014 (r356761) @@ -0,0 +1,74 @@ +diff -Naur epdfview-0.1.8.orig/src/PrintPter.cxx epdfview-0.1.8/src/PrintPter.cxx +--- src/PrintPter.cxx 2011-05-28 11:25:01.000000000 +0100 ++++ src/PrintPter.cxx 2012-08-22 20:11:46.362436859 +0100 +@@ -22,6 +22,40 @@ + #include + #include "epdfview.h" + ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++inline int ippGetInteger (ipp_attribute_t *attr, int element) ++{ ++ return (attr->values[element].integer); ++} ++ ++inline const char * ippGetString (ipp_attribute_t *attr, ++ int element, ++ const char **language /*UNUSED*/) ++{ ++ return (attr->values[element].string.text); ++} ++ ++inline int ippSetOperation (ipp_t *ipp, ipp_op_t op) ++{ ++ if (!ipp) ++ return (0); ++ ipp->request.op.operation_id = op; ++ return (1); ++} ++ ++inline int ippSetRequestId (ipp_t *ipp, int request_id) ++{ ++ if (!ipp) ++ return (0); ++ ipp->request.any.request_id = request_id; ++ return (1); ++} ++#endif ++ + using namespace ePDFView; + + // Structures +@@ -380,8 +414,8 @@ + + ipp_t *request = ippNew (); + +- request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; +- request->request.op.request_id = 1; ++ ippSetOperation(request, IPP_GET_PRINTER_ATTRIBUTES); ++ ippSetRequestId(request, 1); + + ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, + "attributes-charset", NULL, "utf-8"); +@@ -403,7 +437,7 @@ + ippFindAttribute (answer, "printer-state", IPP_TAG_ZERO); + if ( NULL != state ) + { +- switch (state->values[0].integer) ++ switch (ippGetInteger (state, 0)) + { + case IPP_PRINTER_IDLE: + attributes->state = g_strdup (_("Idle")); +@@ -425,7 +459,7 @@ + ippFindAttribute (answer, "printer-location", IPP_TAG_ZERO); + if ( NULL != location ) + { +- attributes->location = g_strdup (location->values[0].string.text); ++ attributes->location = g_strdup (ippGetString (location, 0, NULL)); + } + + ippDelete (answer); +