Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From ae3370788ed3447bba16969d9eb1bf1b9631e1b7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Valentin Popa <valentin.popa@intel.com> |
| 3 | Date: Fri, 25 Apr 2014 13:58:55 +0300 |
| 4 | Subject: [PATCH] Correct rpl_gettimeofday signature |
| 5 | |
| 6 | Currently we fail on uclibc like below |
| 7 | |
| 8 | | In file included from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/procfs.h:32:0, |
| 9 | | from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/ucontext.h:26, |
| 10 | | from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/signal.h:392, |
| 11 | | from ../../gl/signal.h:52, |
| 12 | | from ../../gl/sys/select.h:58, |
| 13 | | from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/types.h:220, |
| 14 | | from ../../gl/sys/types.h:28, |
| 15 | | from ../../lib/includes/gnutls/gnutls.h:46, |
| 16 | | from ex-cxx.cpp:3: |
| 17 | | ../../gl/sys/time.h:396:66: error: conflicting declaration 'void* restrict' |
| 18 | | ../../gl/sys/time.h:396:50: error: 'restrict' has a previous declaration as 'timeval* restrict' |
| 19 | | make[4]: *** [ex-cxx.o] Error 1 |
| 20 | | make[4]: *** Waiting for unfinished jobs.... |
| 21 | |
| 22 | GCC detects that we call 'restrict' as param name in function |
| 23 | signatures and complains since both params are called 'restrict' |
| 24 | therefore we use __restrict to denote the C99 keywork |
| 25 | |
| 26 | This only happens of uclibc since this code is not excercised with |
| 27 | eglibc otherwise we will have same issue there too |
| 28 | |
| 29 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 30 | |
| 31 | Upstream-Status: Pending |
| 32 | --- |
| 33 | gl/sys_time.in.h | 8 ++++---- |
| 34 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 35 | |
| 36 | diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h |
| 37 | index 84a17c9..6ceadc3 100644 |
| 38 | --- a/gl/sys_time.in.h |
| 39 | +++ b/gl/sys_time.in.h |
| 40 | @@ -93,20 +93,20 @@ struct timeval |
| 41 | # define gettimeofday rpl_gettimeofday |
| 42 | # endif |
| 43 | _GL_FUNCDECL_RPL (gettimeofday, int, |
| 44 | - (struct timeval *restrict, void *restrict) |
| 45 | + (struct timeval *__restrict, void *__restrict) |
| 46 | _GL_ARG_NONNULL ((1))); |
| 47 | _GL_CXXALIAS_RPL (gettimeofday, int, |
| 48 | - (struct timeval *restrict, void *restrict)); |
| 49 | + (struct timeval *__restrict, void *__restrict)); |
| 50 | # else |
| 51 | # if !@HAVE_GETTIMEOFDAY@ |
| 52 | _GL_FUNCDECL_SYS (gettimeofday, int, |
| 53 | - (struct timeval *restrict, void *restrict) |
| 54 | + (struct timeval *__restrict, void *__restrict) |
| 55 | _GL_ARG_NONNULL ((1))); |
| 56 | # endif |
| 57 | /* Need to cast, because on glibc systems, by default, the second argument is |
| 58 | struct timezone *. */ |
| 59 | _GL_CXXALIAS_SYS_CAST (gettimeofday, int, |
| 60 | - (struct timeval *restrict, void *restrict)); |
| 61 | + (struct timeval *__restrict, void *__restrict)); |
| 62 | # endif |
| 63 | _GL_CXXALIASWARN (gettimeofday); |
| 64 | #elif defined GNULIB_POSIXCHECK |
| 65 | -- |
| 66 | 1.9.1 |
| 67 | |