chiark / gitweb /
clang: Depend on libgcc (fixes #72)
[termux-packages] / disabled-packages / gcc5 / gcc.patch
1 diff -u -r ../gcc-4.8.2/libcpp/files.c ./libcpp/files.c
2 --- ../gcc-4.8.2/libcpp/files.c 2013-03-06 17:18:40.000000000 +0100
3 +++ ./libcpp/files.c    2014-01-09 00:29:34.940181542 +0100
4 @@ -716,11 +716,13 @@
5      cpp_error (pfile, CPP_DL_WARNING,
6                "%s is shorter than expected", file->path);
7  
8 +  off_t ot = (off_t) &file->st.st_size;
9    file->buffer = _cpp_convert_input (pfile,
10                                      CPP_OPTION (pfile, input_charset),
11                                      buf, size + 16, total,
12                                      &file->buffer_start,
13 -                                    &file->st.st_size);
14 +                                    &ot);
15 +  file->st.st_size = ot;
16    file->buffer_valid = true;
17  
18    return true;
19 diff -u -r ../gcc-4.8.2/libcpp/macro.c ./libcpp/macro.c
20 --- ../gcc-4.8.2/libcpp/macro.c 2013-01-14 19:13:59.000000000 +0100
21 +++ ./libcpp/macro.c    2014-01-09 00:30:49.416179764 +0100
22 @@ -245,8 +245,10 @@
23                    looks like "Sun Sep 16 01:03:52 1973".  */
24                 struct tm *tb = NULL;
25                 struct stat *st = _cpp_get_file_stat (file);
26 -               if (st)
27 -                 tb = localtime (&st->st_mtime);
28 +               if (st) {
29 +                  const time_t mtime = (const time_t) st->st_mtime;
30 +                 tb = localtime (&mtime);
31 +                }
32                 if (tb)
33                   {
34                     char *str = asctime (tb);