Author: imp
Date: Mon Feb 12 14:48:20 2018
New Revision: 329165
URL: https://svnweb.freebsd.org/changeset/base/329165

Log:
  Move __va_list and related defines to sys/sys/_types.h
  
  __va_list and related defines are identical in all the
  ARCH/include/_types.h files. Move them to sys/sys/_types.h
  
  Sponsored by: Netflix

Modified:
  head/sys/arm/include/_types.h
  head/sys/arm64/include/_types.h
  head/sys/mips/include/_types.h
  head/sys/powerpc/include/_types.h
  head/sys/riscv/include/_types.h
  head/sys/sparc64/include/_types.h
  head/sys/sys/_types.h
  head/sys/x86/include/_types.h

Modified: head/sys/arm/include/_types.h
==============================================================================
--- head/sys/arm/include/_types.h       Mon Feb 12 14:48:14 2018        
(r329164)
+++ head/sys/arm/include/_types.h       Mon Feb 12 14:48:20 2018        
(r329165)
@@ -109,18 +109,4 @@ typedef    unsigned int    ___wchar_t;
 #define        __WCHAR_MIN     0               /* min value for a wchar_t */
 #define        __WCHAR_MAX     __UINT_MAX      /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list      __va_list;      /* internally known to gcc */
-#else
-typedef        char *                  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \
-    && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/arm64/include/_types.h
==============================================================================
--- head/sys/arm64/include/_types.h     Mon Feb 12 14:48:14 2018        
(r329164)
+++ head/sys/arm64/include/_types.h     Mon Feb 12 14:48:20 2018        
(r329165)
@@ -95,18 +95,4 @@ typedef      unsigned int    ___wchar_t;
 #define        __WCHAR_MIN     0               /* min value for a wchar_t */
 #define        __WCHAR_MAX     __UINT_MAX      /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list      __va_list;      /* internally known to gcc */
-#else
-typedef        char *                  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \
-    && !defined(__NO_GNUC_VA_LIST)
-#define        __GNUC_VA_LIST
-typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/mips/include/_types.h
==============================================================================
--- head/sys/mips/include/_types.h      Mon Feb 12 14:48:14 2018        
(r329164)
+++ head/sys/mips/include/_types.h      Mon Feb 12 14:48:20 2018        
(r329165)
@@ -150,18 +150,4 @@ typedef    int             ___wchar_t;
 #define        __WCHAR_MIN     __INT_MIN       /* min value for a wchar_t */
 #define        __WCHAR_MAX     __INT_MAX       /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list      __va_list;      /* internally known to gcc */
-#else
-typedef        char *                  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
-    && !defined(__NO_GNUC_VA_LIST)
-#define        __GNUC_VA_LIST
-typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/powerpc/include/_types.h
==============================================================================
--- head/sys/powerpc/include/_types.h   Mon Feb 12 14:48:14 2018        
(r329164)
+++ head/sys/powerpc/include/_types.h   Mon Feb 12 14:48:20 2018        
(r329165)
@@ -144,24 +144,4 @@ typedef    int             ___wchar_t;
 #define        __WCHAR_MIN     __INT_MIN       /* min value for a wchar_t */
 #define        __WCHAR_MAX     __INT_MAX       /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#if defined(__GNUCLIKE_BUILTIN_VARARGS)
-typedef __builtin_va_list      __va_list;      /* internally known to gcc */
-#else
-typedef        struct {
-       char    __gpr;
-       char    __fpr;
-       char    __pad[2];
-       char    *__stack;
-       char    *__base;
-} __va_list;
-#endif /* post GCC 2.95 */
-#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
-    && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/riscv/include/_types.h
==============================================================================
--- head/sys/riscv/include/_types.h     Mon Feb 12 14:48:14 2018        
(r329164)
+++ head/sys/riscv/include/_types.h     Mon Feb 12 14:48:20 2018        
(r329165)
@@ -95,18 +95,4 @@ typedef      int             ___wchar_t;
 #define        __WCHAR_MIN     __INT_MIN       /* min value for a wchar_t */
 #define        __WCHAR_MAX     __INT_MAX       /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list      __va_list;      /* internally known to gcc */
-#else
-typedef        char *                  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \
-    && !defined(__NO_GNUC_VA_LIST)
-#define        __GNUC_VA_LIST
-typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/sparc64/include/_types.h
==============================================================================
--- head/sys/sparc64/include/_types.h   Mon Feb 12 14:48:14 2018        
(r329164)
+++ head/sys/sparc64/include/_types.h   Mon Feb 12 14:48:20 2018        
(r329165)
@@ -97,18 +97,4 @@ typedef      int             ___wchar_t;
 #define        __WCHAR_MIN     __INT_MIN       /* min value for a wchar_t */
 #define        __WCHAR_MAX     __INT_MAX       /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list      __va_list;      /* internally known to gcc */
-#else
-typedef        char *                  __va_list;
-#endif /* __GNUCLIKE_BUILTIN_VARARGS */
-#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \
-    && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */

Modified: head/sys/sys/_types.h
==============================================================================
--- head/sys/sys/_types.h       Mon Feb 12 14:48:14 2018        (r329164)
+++ head/sys/sys/_types.h       Mon Feb 12 14:48:20 2018        (r329165)
@@ -123,6 +123,21 @@ typedef union {
 typedef __uintmax_t     __rman_res_t;
 
 /*
+ * Types for varargs. These are all provided by builtin types these
+ * days, so centralize their definition.
+ */
+#ifdef __GNUCLIKE_BUILTIN_VARARGS
+typedef        __builtin_va_list       __va_list;      /* internally known to 
gcc */
+#else
+#error "No support for your compiler for stdargs"
+#endif
+#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
+    && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+/*
  * When the following macro is defined, the system uses 64-bit inode numbers.
  * Programs can use this to avoid including <sys/param.h>, with its associated
  * namespace pollution.

Modified: head/sys/x86/include/_types.h
==============================================================================
--- head/sys/x86/include/_types.h       Mon Feb 12 14:48:14 2018        
(r329164)
+++ head/sys/x86/include/_types.h       Mon Feb 12 14:48:20 2018        
(r329165)
@@ -143,26 +143,4 @@ typedef    int             ___wchar_t;
 #define        __WCHAR_MIN     __INT_MIN       /* min value for a wchar_t */
 #define        __WCHAR_MAX     __INT_MAX       /* max value for a wchar_t */
 
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef        __builtin_va_list       __va_list;      /* internally known to 
gcc */
-#else
-#ifdef __LP64__
-struct __s_va_list {
-       __uint32_t      _pad1[2];       /* gp_offset, fp_offset */
-       __uint64_t      _pad2[2];       /* overflow_arg_area, reg_save_area */
-};
-typedef        struct __s_va_list      __va_list;
-#else
-typedef        char *                  __va_list;
-#endif
-#endif
-#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
-    && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list              __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
 #endif /* !_MACHINE__TYPES_H_ */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to