aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/libgcrypt/01-inline-gcc.patch
blob: 3a0fe015ac188bb4199ef3376c3dca6cb32b0486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 5abc06114e91beca0177331e1c79815f5fb6d7be Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Thu, 8 Nov 2012 15:38:44 +0100
Subject: [PATCH] Fix extern inline use for gcc > 4.3 in c99 mode

* mpi/mpi-inline.h [!G10_MPI_INLINE_DECL]: Take care of changed extern
inline semantics in gcc.
--

I am not use how this will work out with non-gcc. However, we had no
problems in the past and thus this change is the least invasive for
non-gcc compilers.

GnuPG-bug-id: 1406, 1435
---
 mpi/mpi-inline.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/mpi/mpi-inline.h b/mpi/mpi-inline.h
index 88d9f56..94e2aec 100644
--- a/mpi/mpi-inline.h
+++ b/mpi/mpi-inline.h
@@ -28,8 +28,15 @@
 #ifndef G10_MPI_INLINE_H
 #define G10_MPI_INLINE_H
 
+/* Starting with gcc 4.3 "extern inline" conforms in c99 mode to the
+   c99 semantics.  To keep the useful old semantics we use an
+   attribute.  */
 #ifndef G10_MPI_INLINE_DECL
-#define G10_MPI_INLINE_DECL  extern __inline__
+# ifdef __GNUC_STDC_INLINE__
+#  define G10_MPI_INLINE_DECL  extern inline __attribute__ ((__gnu_inline__))
+# else
+#  define G10_MPI_INLINE_DECL  extern __inline__
+# endif
 #endif
 
 G10_MPI_INLINE_DECL  mpi_limb_t
-- 
1.7.2.5