0
0
mirror of https://github.com/openwrt/packages.git synced 2025-07-15 22:54:47 +00:00
Files
packages/utils/unzip/patches/012-fix-gcc15-build.patch
Tan Zien d3a2fb39a7 unzip: fix build GCC 15.1
refer to:

b7410ac718/main/unzip/gcc15.patch

fix this:

unix/unxcfg.h:120:15: error: conflicting types for 'gmtime'; have 'struct tm *(void)'
  120 |    struct tm *gmtime(), *localtime();
      |               ^~~~~~
In file included from unix/unxcfg.h:119:
/home/nasbdh9/openwrt/staging_dir/toolchain-x86_64_gcc-15.1.0_musl/include/time.h:59:12: note: previous declaration of 'gmtime' with type 'struct tm *(const time_t *)' {aka 'struct tm *(const long int *)'}
   59 | struct tm *gmtime (const time_t *);
      |            ^~~~~~
unix/unxcfg.h:120:26: error: conflicting types for 'localtime'; have 'struct tm *(void)'
  120 |    struct tm *gmtime(), *localtime();
      |                          ^~~~~~~~~
/home/nasbdh9/openwrt/staging_dir/toolchain-x86_64_gcc-15.1.0_musl/include/time.h:60:12: note: previous declaration of 'localtime' with type 'struct tm *(const time_t *)' {aka 'struct tm *(const long int *)'}
   60 | struct tm *localtime (const time_t *);
      |            ^~~~~~~~~

Signed-off-by: Tan Zien <nabsdh9@gmail.com>
2025-07-09 18:52:06 +08:00

12 lines
303 B
Diff

--- a/unix/unxcfg.h
+++ b/unix/unxcfg.h
@@ -117,7 +117,7 @@ typedef struct stat z_stat;
# endif
#else
# include <time.h>
- struct tm *gmtime(), *localtime();
+ struct tm *gmtime(const time_t *), *localtime(const time_t *);
#endif
#if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN)))