[PATCH 4/5] Deal with c99 inline semantics.

Thomas Klausner tk at giga.or.at
Sat Oct 27 19:56:10 CEST 2012


From: Thomas Klausner <wiz at NetBSD.org>

Needed for compilation with recent LLVM/Clang.
---
 mpi/mpi-inline.h   |  4 ----
 mpi/mpi-internal.h | 20 ++++++++++++++------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/mpi/mpi-inline.h b/mpi/mpi-inline.h
index c32adae..31a6362 100644
--- a/mpi/mpi-inline.h
+++ b/mpi/mpi-inline.h
@@ -28,10 +28,6 @@
 #ifndef G10_MPI_INLINE_H
 #define G10_MPI_INLINE_H
 
-#ifndef G10_MPI_INLINE_DECL
-#define G10_MPI_INLINE_DECL  extern __inline__
-#endif
-
 G10_MPI_INLINE_DECL  mpi_limb_t
 mpihelp_add_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
 	       mpi_size_t s1_size, mpi_limb_t s2_limb)
diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h
index c1df30a..38a624e 100644
--- a/mpi/mpi-internal.h
+++ b/mpi/mpi-internal.h
@@ -29,6 +29,14 @@
 #ifndef G10_MPI_INTERNAL_H
 #define G10_MPI_INTERNAL_H
 
+#ifndef G10_MPI_INLINE_DECL
+#if defined(__GNUC_STDC_INLINE__) && __GNUC_STDC_INLINE__
+#define G10_MPI_INLINE_DECL  __inline__
+#else
+#define G10_MPI_INLINE_DECL  extern __inline__
+#endif
+#endif
+
 #include "mpi.h"
 #include "mpi-asm-defs.h"
 
@@ -198,19 +206,19 @@ void mpi_lshift_limbs( MPI a, unsigned int count );
 
 
 /*-- mpihelp-add.c --*/
-mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr,  mpi_ptr_t s1_ptr,
+G10_MPI_INLINE_DECL mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr,  mpi_ptr_t s1_ptr,
 			 mpi_size_t s1_size, mpi_limb_t s2_limb );
-mpi_limb_t mpihelp_add_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+G10_MPI_INLINE_DECL mpi_limb_t mpihelp_add_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
 			  mpi_ptr_t s2_ptr,  mpi_size_t size);
-mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
+G10_MPI_INLINE_DECL mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
 		       mpi_ptr_t s2_ptr, mpi_size_t s2_size);
 
 /*-- mpihelp-sub.c --*/
-mpi_limb_t mpihelp_sub_1( mpi_ptr_t res_ptr,  mpi_ptr_t s1_ptr,
+G10_MPI_INLINE_DECL mpi_limb_t mpihelp_sub_1( mpi_ptr_t res_ptr,  mpi_ptr_t s1_ptr,
 			  mpi_size_t s1_size, mpi_limb_t s2_limb );
-mpi_limb_t mpihelp_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+G10_MPI_INLINE_DECL mpi_limb_t mpihelp_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
 			  mpi_ptr_t s2_ptr, mpi_size_t size);
-mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
+G10_MPI_INLINE_DECL mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
 		       mpi_ptr_t s2_ptr, mpi_size_t s2_size);
 
 /*-- mpihelp-cmp.c --*/
-- 
1.7.12.2




More information about the Gnupg-devel mailing list