Source-Changes-HG archive

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

[src/netbsd-3-0]: src/sys/arch Pull up following revision(s) (requested by na...



details:   https://anonhg.NetBSD.org/src/rev/3e8dc29ae755
branches:  netbsd-3-0
changeset: 579213:3e8dc29ae755
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Apr 30 23:31:32 2006 +0000

description:
Pull up following revision(s) (requested by nakayama in ticket #1296):
        sys/arch/sparc/include/stdarg.h: revision 1.22
        sys/arch/sparc64/include/ansi.h: revision 1.10
        sys/arch/sparc/include/ansi.h: revision 1.16
For GCC3 and later, use the __builtin_va* constructs.

diffstat:

 sys/arch/sparc/include/ansi.h   |   7 ++++-
 sys/arch/sparc/include/stdarg.h |  51 +++++++++++++++++++++-------------------
 sys/arch/sparc64/include/ansi.h |   7 ++++-
 3 files changed, 39 insertions(+), 26 deletions(-)

diffs (154 lines):

diff -r 7f906ab42739 -r 3e8dc29ae755 sys/arch/sparc/include/ansi.h
--- a/sys/arch/sparc/include/ansi.h     Fri Apr 28 22:32:51 2006 +0000
+++ b/sys/arch/sparc/include/ansi.h     Sun Apr 30 23:31:32 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ansi.h,v 1.15 2003/08/07 16:29:38 agc Exp $ */
+/*     $NetBSD: ansi.h,v 1.15.18.1 2006/04/30 23:31:32 riz Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -34,6 +34,7 @@
 #ifndef        _ANSI_H_
 #define        _ANSI_H_
 
+#include <sys/cdefs.h>
 #include <machine/int_types.h>
 
 /*
@@ -50,7 +51,11 @@
 #define        _BSD_SIZE_T_            unsigned long   /* sizeof() */
 #define        _BSD_SSIZE_T_           long            /* byte count or error */
 #define        _BSD_TIME_T_            long            /* time() */
+#if __GNUC_PREREQ__(3, 0)
+#define        _BSD_VA_LIST_           __builtin_va_list /* va_list */
+#else
 #define        _BSD_VA_LIST_           char *          /* va_list */
+#endif
 #define        _BSD_CLOCKID_T_         int             /* clockid_t */
 #define        _BSD_TIMER_T_           int             /* timer_t */
 #define        _BSD_SUSECONDS_T_       int             /* suseconds_t */
diff -r 7f906ab42739 -r 3e8dc29ae755 sys/arch/sparc/include/stdarg.h
--- a/sys/arch/sparc/include/stdarg.h   Fri Apr 28 22:32:51 2006 +0000
+++ b/sys/arch/sparc/include/stdarg.h   Sun Apr 30 23:31:32 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stdarg.h,v 1.21 2004/12/30 16:22:27 christos Exp $ */
+/*     $NetBSD: stdarg.h,v 1.21.10.1 2006/04/30 23:31:32 riz Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -49,26 +49,30 @@
 typedef _BSD_VA_LIST_  va_list;
 
 #ifdef __lint__
-# define va_start(ap, last) (ap) = (va_list)(void *)&(last)
+
+# define va_start(ap, last)    ((ap) = *(va_list *)0)
+# define va_arg(ap, type)      (*(type *)(void *)&(ap))
+# define va_end(ap)
+# define __va_copy(dest, src)  ((dest) = (src))
+
+#elif __GNUC_PREREQ__(3,0)
+
+# define va_start(ap, last)    __builtin_va_start(ap, last)
+# define va_end(ap)            __builtin_va_end(ap)
+# define va_arg(ap, type)      __builtin_va_arg(ap, type)
+# define __va_copy(dst, src)   __builtin_va_copy(dst, src)
+
 #else
+
 # define va_start(ap, last) \
        (void)(__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs())
-#endif
 
 
-#if !defined(_ANSI_SOURCE) &&                                          \
-    (defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L ||   \
-     defined(_NETBSD_SOURCE))
-# define va_copy(dest, src) \
+# define va_end(ap)    
+# define __va_copy(dest, src) \
        ((dest) = (src))
-#endif
 
-#define va_end(ap)     
-
-#ifdef __arch64__
-# ifdef __lint__
-#  define va_arg(ap, type)     (*(type *)(void *)(ap)) 
-# else /* !__lint__ */
+# ifdef __arch64__
 /*
  * For sparcv9 code.
  */
@@ -91,14 +95,10 @@
          (sizeof(type) <= 8 ? __va_arg8(ap, type) :                    \
           (sizeof(type) <= 16 ? __va_arg16(ap, type) :                 \
            *__va_arg8(ap, type *)))))
-# endif /* __lint__ */
-#else /* __arch64__ */
+# else /* __arch64__ */
 /* 
  * For sparcv8 code.
  */
-# ifdef __lint__
-#  define va_arg(ap, type)     (*(type *)(void *)(ap)) 
-# else /* !__lint__ */
 #  define __va_size(type) \
        (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
 
@@ -118,9 +118,6 @@
  * have a constructor.
  */
 
-#  if __GNUC__ < 2
-#   define __extension__       /* delete __extension__ if non-gcc or gcc1 */
-#  endif
 #  define __va_8byte(ap, type) \
        __extension__ ({                                                \
                union { char __d[sizeof(type)]; int __i[2]; } __va_u;   \
@@ -140,8 +137,14 @@
        (__builtin_classify_type(*(type *)0) >= __RECORD_TYPE_CLASS ?   \
         *__va_arg(ap, type *) : __va_size(type) == 8 ?                 \
         __va_8byte(ap, type) : __va_arg(ap, type))
-# endif /* __lint__ */
+
+# endif /* __arch64__ */
+#endif /* !__GNUC_PREREQ(3, 0) */
 
-#endif /* __arch64__ */
+#if !defined(_ANSI_SOURCE) &&                                          \
+    (defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L ||   \
+     defined(_NETBSD_SOURCE))
+# define va_copy(dst, src)     __va_copy(dst, src)
+#endif
 
 #endif /* !_SPARC_STDARG_H_ */
diff -r 7f906ab42739 -r 3e8dc29ae755 sys/arch/sparc64/include/ansi.h
--- a/sys/arch/sparc64/include/ansi.h   Fri Apr 28 22:32:51 2006 +0000
+++ b/sys/arch/sparc64/include/ansi.h   Sun Apr 30 23:31:32 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ansi.h,v 1.9 2003/08/07 16:29:49 agc Exp $ */
+/*     $NetBSD: ansi.h,v 1.9.18.1 2006/04/30 23:31:32 riz Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -34,6 +34,7 @@
 #ifndef        _ANSI_H_
 #define        _ANSI_H_
 
+#include <sys/cdefs.h>
 #include <machine/int_types.h>
 
 /*
@@ -50,7 +51,11 @@
 #define        _BSD_SIZE_T_            unsigned long   /* sizeof() */
 #define        _BSD_SSIZE_T_           long            /* byte count or error */
 #define        _BSD_TIME_T_            int             /* time() */
+#if __GNUC_PREREQ__(3, 0)
+#define        _BSD_VA_LIST_           __builtin_va_list /* va_list */
+#else
 #define        _BSD_VA_LIST_           char *          /* va_list */
+#endif
 #define        _BSD_CLOCKID_T_         int             /* clockid_t */
 #define        _BSD_TIMER_T_           int             /* timer_t */
 #define        _BSD_SUSECONDS_T_       int             /* suseconds_t */



Home | Main Index | Thread Index | Old Index