diff options
author | nox <nox@FreeBSD.org> | 2012-10-03 23:38:19 +0800 |
---|---|---|
committer | nox <nox@FreeBSD.org> | 2012-10-03 23:38:19 +0800 |
commit | 362a035a146828875f4679007ec8fdea9601123f (patch) | |
tree | 308d73565e42d6089c2951ea56e9563efd80a15c /multimedia/w_scan | |
parent | e5356468054fb035372dca6eff55a21d6c0d0c5b (diff) | |
download | freebsd-ports-gnome-362a035a146828875f4679007ec8fdea9601123f.tar.gz freebsd-ports-gnome-362a035a146828875f4679007ec8fdea9601123f.tar.zst freebsd-ports-gnome-362a035a146828875f4679007ec8fdea9601123f.zip |
Fix build with clang.
PR: ports/172300
Submitted by: Miklos Magyari <magyarimiki@gmail.com>
Diffstat (limited to 'multimedia/w_scan')
-rw-r--r-- | multimedia/w_scan/files/patch-clang | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/multimedia/w_scan/files/patch-clang b/multimedia/w_scan/files/patch-clang new file mode 100644 index 000000000000..77120dd5a8df --- /dev/null +++ b/multimedia/w_scan/files/patch-clang @@ -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; + + |