insop / rtos

Real-time OS (RTOS) FEMOS (Fast EMbedded OS). [search keywords: Waterloo CS452]
GNU General Public License v3.0
2 stars 5 forks source link

Redefined macros #1

Open jserv opened 11 years ago

jserv commented 11 years ago

Since the code was written more than 10 years ago, there are some old usages, especially for macro definitions.

To make GCC happy, we might need the following changes:

diff --git a/include/i486/i386/ansi.h b/include/i486/i386/ansi.h
index c73979e..d858ec3 100644
--- a/include/i486/i386/ansi.h
+++ b/include/i486/i386/ansi.h
@@ -48,7 +48,9 @@
  */
 #define    _BSD_CLOCK_T_   unsigned long       /* clock() */
 #define    _BSD_PTRDIFF_T_ int         /* ptr1 - ptr2 */
+#ifndef _BSD_SIZE_T_
 #define    _BSD_SIZE_T_    unsigned int        /* sizeof() */
+#endif
 #define    _BSD_SSIZE_T_   int         /* byte count or error */
 #define    _BSD_TIME_T_    long            /* time() */
 #define    _BSD_VA_LIST_   char *          /* va_list */
diff --git a/include/i486/machine/ansi.h b/include/i486/machine/ansi.h
index c73979e..d858ec3 100644
--- a/include/i486/machine/ansi.h
+++ b/include/i486/machine/ansi.h
@@ -48,7 +48,9 @@
  */
 #define    _BSD_CLOCK_T_   unsigned long       /* clock() */
 #define    _BSD_PTRDIFF_T_ int         /* ptr1 - ptr2 */
+#ifndef _BSD_SIZE_T_
 #define    _BSD_SIZE_T_    unsigned int        /* sizeof() */
+#endif
 #define    _BSD_SSIZE_T_   int         /* byte count or error */
 #define    _BSD_TIME_T_    long            /* time() */
 #define    _BSD_VA_LIST_   char *          /* va_list */
diff --git a/include/i486/sys/cdefs.h b/include/i486/sys/cdefs.h
index 9457193..f16954c 100644
--- a/include/i486/sys/cdefs.h
+++ b/include/i486/sys/cdefs.h
@@ -57,7 +57,9 @@
  * strings produced by the __STRING macro, but this only works with ANSI C.
  */
 #if defined(__STDC__) || defined(__cplusplus)
+#ifndef __P
 #define    __P(protos) protos      /* full-blown ANSI C */
+#endif
 #define    __CONCAT(x,y)   x ## y
 #define    __STRING(x) #x
insop commented 11 years ago

Hi Jim,

Sounds fine to me, could you send pull request or format-patch format file? then I will apply your suggestion.

Insop