From owner-svn-ports-head@FreeBSD.ORG Wed Oct 3 15:38:20 2012 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35B52106564A; Wed, 3 Oct 2012 15:38:20 +0000 (UTC) (envelope-from nox@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2046B8FC17; Wed, 3 Oct 2012 15:38:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q93FcJ1m051464; Wed, 3 Oct 2012 15:38:19 GMT (envelope-from nox@svn.freebsd.org) Received: (from nox@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q93FcJ1R051463; Wed, 3 Oct 2012 15:38:19 GMT (envelope-from nox@svn.freebsd.org) Message-Id: <201210031538.q93FcJ1R051463@svn.freebsd.org> From: Juergen Lock Date: Wed, 3 Oct 2012 15:38:19 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r305207 - head/multimedia/w_scan/files X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Oct 2012 15:38:20 -0000 Author: nox Date: Wed Oct 3 15:38:19 2012 New Revision: 305207 URL: http://svn.freebsd.org/changeset/ports/305207 Log: Fix build with clang. PR: ports/172300 Submitted by: Miklos Magyari Added: head/multimedia/w_scan/files/patch-clang (contents, props changed) Added: head/multimedia/w_scan/files/patch-clang ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/w_scan/files/patch-clang Wed Oct 3 15:38:19 2012 (r305207) @@ -0,0 +1,41 @@ +The code is using gnu C extensions. The following new patchfile under files/ fixes the issue: + +# cat files/patch-descriptors.c +--- a/descriptors.c 2012-10-03 12:39:42.000000000 +0200 ++++ b/descriptors.c 2012-10-03 12:39:56.000000000 +0200 +@@ -1000,6 +1000,16 @@ + } + } + ++__u8 LeapYear(__u16 year) { ++ if ((year % 400) == 0) ++ return 1; ++ else if ((year % 100) == 0) ++ return 0; ++ else if ((year % 4) == 0) ++ return 1; ++ return 0; ++} ++ + + /* 300468 v011101 annex C, Conversion between time and date conventions + * NOTE: These formulas are applicable between the inclusive dates 1900 March 1 to 2100 February 28. +@@ -1011,16 +1021,6 @@ + int _M = (int) (MJD - 14956.1 - (int) (_Y * 365.25)) / 30.6001; + int K = (_M == 14) ? 1 : (_M == 15) ? 1 : 0; + +- __u8 LeapYear(__u16 year) { +- if ((year % 400) == 0) +- return 1; +- else if ((year % 100) == 0) +- return 0; +- else if ((year % 4) == 0) +- return 1; +- return 0; +- } +- + memset(&utc, 0, sizeof(struct tm)); + utc.tm_mday = MJD - 14956 - (int) (_Y * 365.25) - (int) (_M * 30.6001); + utc.tm_year = _Y + K; + +