[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] almost there..... Newbie trying to compile Mint v1.17...



On Fri, 2011-02-11 at 10:27 +0100, Vincent Rivière wrote:
> Alan Hourihane wrote:
> > Can you try this patch ?
> 
> For the first time I understand that the attribute __always_inline__ did 
> not exist in GCC 2.95, and it is the source of our problem...
> 
> To fix such issues, the glibc used on Linux does the following:
> 
> /usr/include/sys/cdefs.h
> 
> /* Forces a function to be always inlined.  */
> #if __GNUC_PREREQ (3,2)
> # define __always_inline __inline __attribute__ ((__always_inline__))
> #else
> # define __always_inline __inline
> #endif
> 
> Then __always_inline is used everywhere.
> We should do the same.

So in that regard, try this....

Alan.
Index: sys/mint/kcompiler.h
===================================================================
RCS file: /mint/freemint/sys/mint/kcompiler.h,v
retrieving revision 1.7
diff -u -r1.7 kcompiler.h
--- sys/mint/kcompiler.h	13 Jan 2010 17:13:50 -0000	1.7
+++ sys/mint/kcompiler.h	11 Feb 2011 09:47:10 -0000
@@ -68,15 +68,13 @@
 # endif
 
 
-/* define to mark a function as inline: */
-# ifdef __GNUC__
-# define INLINE		static inline __attribute__((always_inline))
-# endif
+/* Forces a function to be always inlined.  */
+#if __GNUC_PREREQ (3,2)
+# define INLINE static __inline __attribute__ ((__always_inline__))
+#else
+# define INLINE static __inline
+#endif
 
-/* default: */
-# ifndef INLINE
-# define INLINE		static
-# endif
 
 /* define to indicate unused variables: */
 # ifdef __TURBOC__
Index: sys/sockets/global.h
===================================================================
RCS file: /mint/freemint/sys/sockets/global.h,v
retrieving revision 1.9
diff -u -r1.9 global.h
--- sys/sockets/global.h	13 Jan 2010 17:13:50 -0000	1.9
+++ sys/sockets/global.h	11 Feb 2011 09:47:10 -0000
@@ -101,7 +101,7 @@
 	return 0;
 }
 
-static inline __attribute__((always_inline)) void
+static INLINE void
 so_wakersel (struct socket *so)
 {
 	if (so->rsel)