aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/include/_types.h11
-rw-r--r--sys/sparc64/include/critical.h6
-rw-r--r--sys/sparc64/include/endian.h2
-rw-r--r--sys/sparc64/include/stdarg.h10
-rw-r--r--sys/sparc64/include/varargs.h14
5 files changed, 26 insertions, 17 deletions
diff --git a/sys/sparc64/include/_types.h b/sys/sparc64/include/_types.h
index f014b54eb1f7..f810c159a6ef 100644
--- a/sys/sparc64/include/_types.h
+++ b/sys/sparc64/include/_types.h
@@ -35,6 +35,10 @@
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
+#ifndef _SYS_CDEFS_H_
+#error this file needs sys/cdefs.h as a prerequisite
+#endif
+
/*
* Basic types upon which most other types are built.
*/
@@ -93,12 +97,13 @@ typedef __uint64_t __vm_size_t;
/*
* Unusual type definitions.
*/
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+#ifdef __GNUCLIKE_BUILTIN_VARARGS
typedef __builtin_va_list __va_list; /* internally known to gcc */
#else
typedef char * __va_list;
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_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
diff --git a/sys/sparc64/include/critical.h b/sys/sparc64/include/critical.h
index 381ec453602a..999a5fddc208 100644
--- a/sys/sparc64/include/critical.h
+++ b/sys/sparc64/include/critical.h
@@ -46,7 +46,7 @@ __BEGIN_DECLS
*/
void cpu_critical_fork_exit(void);
-#ifdef __GNUC__
+#ifdef __CC_SUPPORTS___INLINE
/*
* cpu_critical_enter:
@@ -79,12 +79,12 @@ cpu_critical_exit(struct thread *td)
wrpr(pil, td->td_md.md_savecrit, 0);
}
-#else /* !__GNUC__ */
+#else /* !__CC_SUPPORTS___INLINE */
void cpu_critical_enter(struct thread *td);
void cpu_critical_exit(struct thread *td);
-#endif /* __GNUC__ */
+#endif /* __CC_SUPPORTS___INLINE */
__END_DECLS
diff --git a/sys/sparc64/include/endian.h b/sys/sparc64/include/endian.h
index a3b9c2db476e..a643dd3537c8 100644
--- a/sys/sparc64/include/endian.h
+++ b/sys/sparc64/include/endian.h
@@ -63,7 +63,7 @@
#define BYTE_ORDER _BYTE_ORDER
#endif
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
+#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__)
#define __is_constant(x) __builtin_constant_p(x)
#else
#define __is_constant(x) 0
diff --git a/sys/sparc64/include/stdarg.h b/sys/sparc64/include/stdarg.h
index bd4e9ddeb905..a7ff28484389 100644
--- a/sys/sparc64/include/stdarg.h
+++ b/sys/sparc64/include/stdarg.h
@@ -49,7 +49,7 @@
typedef __va_list va_list;
#endif
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+#ifdef __GNUCLIKE_BUILTIN_STDARG
#define va_start(ap, last) \
__builtin_stdarg_start((ap), (last))
@@ -65,7 +65,11 @@ typedef __va_list va_list;
#define va_end(ap) \
__builtin_va_end(ap)
-#else /* ! __GNUC__ post GCC 2.95 */
+#else /* ! __GNUCLIKE_BUILTIN_STDARG */
+
+#if !defined(__GNUCLIKE_BUILTIN_NEXT_ARG) && !defined(lint)
+#error no support for your compiler
+#endif
#define va_start(ap, last) \
(__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs())
@@ -92,6 +96,6 @@ typedef __va_list va_list;
(sizeof(type) <= 16 ? __va_arg16(ap, type) : \
*__va_arg8(ap, type *)))))
-#endif /* __GNUC__ post GCC 2.95 */
+#endif /* __GNUCLIKE_BUILTIN_STDARG */
#endif /* !_MACHINE_STDARG_H_ */
diff --git a/sys/sparc64/include/varargs.h b/sys/sparc64/include/varargs.h
index 165e8078a7a0..a168c6e33c32 100644
--- a/sys/sparc64/include/varargs.h
+++ b/sys/sparc64/include/varargs.h
@@ -52,7 +52,11 @@
#ifndef _MACHINE_VARARGS_H_
#define _MACHINE_VARARGS_H_
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+#ifndef _SYS_CDEFS_H_
+#error this file needs sys/cdefs.h as a prerequisite
+#endif
+
+#ifdef __GNUCLIKE_BUILTIN_VARARGS
#include <sys/_types.h>
@@ -69,15 +73,11 @@ typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_arg(ap, type) __builtin_va_arg((ap), type)
#define va_end(ap) __builtin_va_end(ap)
-#else /* ! __GNUC__ post GCC 2.95 */
+#else /* !__GNUCLIKE_BUILTIN_VARARGS */
#include <machine/stdarg.h>
-#if __GNUC__ == 1
-#define __va_ellipsis
-#else
#define __va_ellipsis ...
-#endif
#define va_alist __builtin_va_alist
#define va_dcl long __builtin_va_alist; __va_ellipsis
@@ -86,6 +86,6 @@ typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_start(ap) \
((ap) = (va_list)__builtin_saveregs())
-#endif /* __GNUC__ post GCC 2.95 */
+#endif /* __GNUCLIKE_BUILTIN_VARARGS */
#endif /* !_MACHINE_VARARGS_H_ */