blob: 96b023a4688a858f69517195c956e85b0553c0ae [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001From 81b0f04c14f673b99778d2e7d8e85461e0bf2018 Mon Sep 17 00:00:00 2001
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002From: Valentin Popa <valentin.popa@intel.com>
3Date: Fri, 25 Apr 2014 13:58:55 +0300
Brad Bishop6e60e8b2018-02-01 10:27:11 -05004Subject: [PATCH 1/3] Correct rpl_gettimeofday signature
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
6Currently 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
22GCC detects that we call 'restrict' as param name in function
23signatures and complains since both params are called 'restrict'
24therefore we use __restrict to denote the C99 keywork
25
26This only happens of uclibc since this code is not excercised with
27eglibc otherwise we will have same issue there too
28
29Signed-off-by: Khem Raj <raj.khem@gmail.com>
30
31Upstream-Status: Pending
Brad Bishop6e60e8b2018-02-01 10:27:11 -050032
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033---
34 gl/sys_time.in.h | 8 ++++----
35 1 file changed, 4 insertions(+), 4 deletions(-)
36
37diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
Brad Bishop6e60e8b2018-02-01 10:27:11 -050038index 5a8caf3..2dc5718 100644
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039--- a/gl/sys_time.in.h
40+++ b/gl/sys_time.in.h
41@@ -93,20 +93,20 @@ struct timeval
42 # define gettimeofday rpl_gettimeofday
43 # endif
44 _GL_FUNCDECL_RPL (gettimeofday, int,
45- (struct timeval *restrict, void *restrict)
46+ (struct timeval *__restrict, void *__restrict)
47 _GL_ARG_NONNULL ((1)));
48 _GL_CXXALIAS_RPL (gettimeofday, int,
49- (struct timeval *restrict, void *restrict));
50+ (struct timeval *__restrict, void *__restrict));
51 # else
52 # if !@HAVE_GETTIMEOFDAY@
53 _GL_FUNCDECL_SYS (gettimeofday, int,
54- (struct timeval *restrict, void *restrict)
55+ (struct timeval *__restrict, void *__restrict)
56 _GL_ARG_NONNULL ((1)));
57 # endif
58 /* Need to cast, because on glibc systems, by default, the second argument is
59 struct timezone *. */
60 _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
61- (struct timeval *restrict, void *restrict));
62+ (struct timeval *__restrict, void *__restrict));
63 # endif
64 _GL_CXXALIASWARN (gettimeofday);
Brad Bishop6e60e8b2018-02-01 10:27:11 -050065 # if defined __cplusplus && defined GNULIB_NAMESPACE
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066--
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500672.10.2
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068