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

[MiNT] C99 fixes for MiNTlib



Attached a few warning fixes for MiNTlib when compiling with C99.

Alan.
Index: include/features.h.in
===================================================================
RCS file: /mint/mintlib/include/features.h.in,v
retrieving revision 1.6
diff -u -r1.6 features.h.in
--- include/features.h.in	6 Dec 2005 19:27:53 -0000	1.6
+++ include/features.h.in	26 Feb 2008 13:08:29 -0000
@@ -329,7 +329,8 @@
 
 /* Decide whether we can define 'extern inline' functions in headers.  */
 #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
-    && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
+    && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
+    && !defined __GNUC_STDC_INLINE__
 # define __USE_EXTERN_INLINES	1
 #endif
 
Index: include/stdio.h
===================================================================
RCS file: /mint/mintlib/include/stdio.h,v
retrieving revision 1.4
diff -u -r1.4 stdio.h
--- include/stdio.h	6 Dec 2005 19:27:53 -0000	1.4
+++ include/stdio.h	26 Feb 2008 13:08:29 -0000
@@ -417,7 +417,7 @@
 			  __const char *__restrict __format,
 			  __gnuc_va_list __arg));
 
-#ifdef	__OPTIMIZE__
+#ifdef __USE_EXTERN_INLINES
 extern __inline int
 vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)
 {
@@ -491,7 +491,7 @@
 			 __gnuc_va_list __arg));
 
 
-#ifdef	__OPTIMIZE__
+#ifdef __USE_EXTERN_INLINES
 extern __inline int
 vfscanf (FILE *__s, const char *__fmt, __gnuc_va_list __arg)
 {
@@ -533,7 +533,7 @@
    so we always do the optimization for it.  */
 #define	getc(stream)	__getc(stream)
 
-#ifdef	__OPTIMIZE__
+#ifdef __USE_EXTERN_INLINES
 extern __inline int
 getchar (void)
 {
@@ -546,7 +546,7 @@
 extern int getc_unlocked __P ((FILE *__stream));
 extern int getchar_unlocked __P ((void));
 
-# ifdef __OPTIMIZE__
+# ifdef __USE_EXTERN_INLINES
 extern __inline int
 getc_unlocked (FILE *__stream)
 {
@@ -581,7 +581,7 @@
    so we always do the optimization for it.  */
 #define	putc(c, stream)	__putc ((c), (stream))
 
-#ifdef __OPTIMIZE__
+#ifdef __USE_EXTERN_INLINES
 extern __inline int
 putchar (int __c)
 {
@@ -593,7 +593,7 @@
 /* Faster version when locking is not necessary.  */
 extern int fputc_unlocked __P ((int __c, FILE *__stream));
 
-# ifdef __OPTIMIZE__
+# ifdef __USE_EXTERN_INLINES
 extern __inline int
 fputc_unlocked (int __c, FILE *__stream)
 {
@@ -607,7 +607,7 @@
 extern int putc_unlocked __P ((int __c, FILE *__stream));
 extern int putchar_unlocked __P ((int __c));
 
-# ifdef __OPTIMIZE__
+# ifdef __USE_EXTERN_INLINES
 extern __inline int
 putc_unlocked (int __c, FILE *__stream)
 {
@@ -664,7 +664,7 @@
 ssize_t __getline __P ((char **__lineptr, size_t *__n, FILE *__stream));
 ssize_t getline __P ((char **__lineptr, size_t *__n, FILE *__stream));
 
-#ifdef	__OPTIMIZE__
+#ifdef __USE_EXTERN_INLINES
 extern __inline ssize_t
 getline (char **__lineptr, size_t *__n, FILE *__stream)
 {