The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / at / 0008-remove-glibc-__isleap-assumption.patch
1 From 7f811d9c4ebc9444e613e251c31d6bf537a24dc1 Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Mon, 13 Apr 2015 16:35:30 -0700
4 Subject: [PATCH] remove glibc assumption
5
6 glibc time.h header has an undocumented __isleap macro
7 that we are using anf musl is missing it.
8 Since it is undocumented & does not appear
9 on any other libc, stop using it and just define the macro in
10 locally  instead.
11
12 Upstream-Status: Pending
13
14 Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 [patch from: http://patchwork.openembedded.org/patch/91893/ ]
16 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
17
18 ---
19  parsetime.y | 11 +++++++----
20  1 file changed, 7 insertions(+), 4 deletions(-)
21
22 diff --git a/parsetime.y b/parsetime.y
23 index 7005e88..324e6d3 100644
24 --- a/parsetime.y
25 +++ b/parsetime.y
26 @@ -8,6 +8,9 @@
27  
28  #define YYDEBUG 1
29  
30 +#define is_leap_year(y) \
31 +    ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
32 +
33  struct tm exectm;
34  static int isgmt;
35  static int yearspec;
36 @@ -217,8 +220,8 @@ date            : month_name day_number
37                                  mnum == 12) && dnum > 31)
38                             || ((mnum ==  4 || mnum ==  6 || mnum ==  9 ||
39                                  mnum == 11) && dnum > 30)
40 -                           || (mnum ==  2 && dnum > 29 &&  __isleap(ynum+1900))
41 -                           || (mnum ==  2 && dnum > 28 && !__isleap(ynum+1900))
42 +                           || (mnum ==  2 && dnum > 29 &&  is_leap_year(ynum+1900))
43 +                           || (mnum ==  2 && dnum > 28 && !is_leap_year(ynum+1900))
44                            )
45                         {
46                             yyerror("Error in day of month");
47 @@ -261,8 +264,8 @@ date            : month_name day_number
48                                  mnum == 12) && dnum > 31)
49                             || ((mnum ==  4 || mnum ==  6 || mnum ==  9 ||
50                                  mnum == 11) && dnum > 30)
51 -                           || (mnum ==  2 && dnum > 29 &&  __isleap(ynum+1900))
52 -                           || (mnum ==  2 && dnum > 28 && !__isleap(ynum+1900))
53 +                           || (mnum ==  2 && dnum > 29 &&  is_leap_year(ynum+1900))
54 +                           || (mnum ==  2 && dnum > 28 && !is_leap_year(ynum+1900))
55                            )
56                         {
57                             yyerror("Error in day of month");
58 -- 
59 2.1.4