1From f446686916e503dfb9fb928252d1b72a07573b29 Mon Sep 17 00:00:00 2001 2From: Dengke Du <dengke.du@windriver.com> 3Date: Tue, 18 Jul 2017 03:42:56 -0400 4Subject: [PATCH] remove glibc assumption 5 6glibc time.h header has an undocumented __isleap macro 7that we are using anf musl is missing it. 8Since it is undocumented & does not appear 9on any other libc, stop using it and just define the macro in 10locally instead. 11 12Upstream-Status: Submitted [ https://lists.debian.org/debian-accessibility/2017/07/msg00044.html ] 13 14Signed-off-by: Khem Raj <raj.khem@gmail.com> 15 16Signed-off-by: Dengke Du <dengke.du@windriver.com> 17--- 18 parsetime.y | 11 +++++++---- 19 1 file changed, 7 insertions(+), 4 deletions(-) 20 21Index: at-3.2.1/parsetime.y 22=================================================================== 23--- at-3.2.1.orig/parsetime.y 24+++ at-3.2.1/parsetime.y 25@@ -14,6 +14,9 @@ 26 ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) 27 #endif 28 29+#define is_leap_year(y) \ 30+ ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) 31+ 32 struct tm exectm; 33 static int isgmt; 34 static char *tz = NULL; 35@@ -230,8 +233,8 @@ date : month_name day_number 36 mnum == 12) && dnum > 31) 37 || ((mnum == 4 || mnum == 6 || mnum == 9 || 38 mnum == 11) && dnum > 30) 39- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900)) 40- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900)) 41+ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900)) 42+ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900)) 43 ) 44 { 45 yyerror("Error in day of month"); 46@@ -274,8 +277,8 @@ date : month_name day_number 47 mnum == 12) && dnum > 31) 48 || ((mnum == 4 || mnum == 6 || mnum == 9 || 49 mnum == 11) && dnum > 30) 50- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900)) 51- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900)) 52+ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900)) 53+ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900)) 54 ) 55 { 56 yyerror("Error in day of month"); 57