Module Name:    src
Committed By:   matt
Date:           Wed Jan 29 01:40:35 UTC 2014

Modified Files:
        src/sys/arch/arm/include: int_fmtio.h int_limits.h int_mwgwtypes.h
            int_types.h limits.h

Log Message:
Take advantage of compiler predefines for types.
Add _LP64 support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/include/int_fmtio.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/int_limits.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/include/int_mwgwtypes.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/include/int_types.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/include/limits.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/int_fmtio.h
diff -u src/sys/arch/arm/include/int_fmtio.h:1.5 src/sys/arch/arm/include/int_fmtio.h:1.6
--- src/sys/arch/arm/include/int_fmtio.h:1.5	Fri Aug 29 19:08:29 2008
+++ src/sys/arch/arm/include/int_fmtio.h	Wed Jan 29 01:40:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_fmtio.h,v 1.5 2008/08/29 19:08:29 matt Exp $	*/
+/*	$NetBSD: int_fmtio.h,v 1.6 2014/01/29 01:40:35 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -46,9 +46,15 @@
 #define	PRIdLEAST16	"d"	/* int_least16_t	*/
 #define	PRIdLEAST32	"d"	/* int_least32_t	*/
 #define	PRIdLEAST64	"lld"	/* int_least64_t	*/
+#ifdef _LP64
+#define	PRIdFAST8	"ld"	/* int_fast8_t		*/
+#define	PRIdFAST16	"ld"	/* int_fast16_t		*/
+#define	PRIdFAST32	"ld"	/* int_fast32_t		*/
+#else
 #define	PRIdFAST8	"d"	/* int_fast8_t		*/
 #define	PRIdFAST16	"d"	/* int_fast16_t		*/
 #define	PRIdFAST32	"d"	/* int_fast32_t		*/
+#endif
 #define	PRIdFAST64	"lld"	/* int_fast64_t		*/
 #define	PRIdMAX		"lld"	/* intmax_t		*/
 #define	PRIdPTR		"ld"	/* intptr_t		*/
@@ -61,9 +67,15 @@
 #define	PRIiLEAST16	"i"	/* int_least16_t	*/
 #define	PRIiLEAST32	"i"	/* int_least32_t	*/
 #define	PRIiLEAST64	"lli"	/* int_least64_t	*/
+#ifdef _LP64
+#define	PRIiFAST8	"li"	/* int_fast8_t		*/
+#define	PRIiFAST16	"li"	/* int_fast16_t		*/
+#define	PRIiFAST32	"li"	/* int_fast32_t		*/
+#else
 #define	PRIiFAST8	"i"	/* int_fast8_t		*/
 #define	PRIiFAST16	"i"	/* int_fast16_t		*/
 #define	PRIiFAST32	"i"	/* int_fast32_t		*/
+#endif
 #define	PRIiFAST64	"lli"	/* int_fast64_t		*/
 #define	PRIiMAX		"lli"	/* intmax_t		*/
 #define	PRIiPTR		"li"	/* intptr_t		*/
@@ -78,9 +90,15 @@
 #define	PRIoLEAST16	"o"	/* uint_least16_t	*/
 #define	PRIoLEAST32	"o"	/* uint_least32_t	*/
 #define	PRIoLEAST64	"llo"	/* uint_least64_t	*/
+#ifdef _LP64
+#define	PRIoFAST8	"lo"	/* uint_fast8_t		*/
+#define	PRIoFAST16	"lo"	/* uint_fast16_t	*/
+#define	PRIoFAST32	"lo"	/* uint_fast32_t	*/
+#else
 #define	PRIoFAST8	"o"	/* uint_fast8_t		*/
 #define	PRIoFAST16	"o"	/* uint_fast16_t	*/
 #define	PRIoFAST32	"o"	/* uint_fast32_t	*/
+#endif
 #define	PRIoFAST64	"llo"	/* uint_fast64_t	*/
 #define	PRIoMAX		"llo"	/* uintmax_t		*/
 #define	PRIoPTR		"lo"	/* uintptr_t		*/
@@ -93,9 +111,15 @@
 #define	PRIuLEAST16	"u"	/* uint_least16_t	*/
 #define	PRIuLEAST32	"u"	/* uint_least32_t	*/
 #define	PRIuLEAST64	"llu"	/* uint_least64_t	*/
+#ifdef _LP64
+#define	PRIuFAST8	"lu"	/* uint_fast8_t		*/
+#define	PRIuFAST16	"lu"	/* uint_fast16_t	*/
+#define	PRIuFAST32	"lu"	/* uint_fast32_t	*/
+#else
 #define	PRIuFAST8	"u"	/* uint_fast8_t		*/
 #define	PRIuFAST16	"u"	/* uint_fast16_t	*/
 #define	PRIuFAST32	"u"	/* uint_fast32_t	*/
+#endif
 #define	PRIuFAST64	"llu"	/* uint_fast64_t	*/
 #define	PRIuMAX		"llu"	/* uintmax_t		*/
 #define	PRIuPTR		"lu"	/* uintptr_t		*/
@@ -108,9 +132,15 @@
 #define	PRIxLEAST16	"x"	/* uint_least16_t	*/
 #define	PRIxLEAST32	"x"	/* uint_least32_t	*/
 #define	PRIxLEAST64	"llx"	/* uint_least64_t	*/
+#ifdef _LP64
+#define	PRIxFAST8	"lx"	/* uint_fast8_t		*/
+#define	PRIxFAST16	"lx"	/* uint_fast16_t	*/
+#define	PRIxFAST32	"lx"	/* uint_fast32_t	*/
+#else
 #define	PRIxFAST8	"x"	/* uint_fast8_t		*/
 #define	PRIxFAST16	"x"	/* uint_fast16_t	*/
 #define	PRIxFAST32	"x"	/* uint_fast32_t	*/
+#endif
 #define	PRIxFAST64	"llx"	/* uint_fast64_t	*/
 #define	PRIxMAX		"llx"	/* uintmax_t		*/
 #define	PRIxPTR		"lx"	/* uintptr_t		*/
@@ -123,9 +153,15 @@
 #define	PRIXLEAST16	"X"	/* uint_least16_t	*/
 #define	PRIXLEAST32	"X"	/* uint_least32_t	*/
 #define	PRIXLEAST64	"llX"	/* uint_least64_t	*/
+#ifdef _LP64
+#define	PRIXFAST8	"lX"	/* uint_fast8_t		*/
+#define	PRIXFAST16	"lX"	/* uint_fast16_t	*/
+#define	PRIXFAST32	"lX"	/* uint_fast32_t	*/
+#else
 #define	PRIXFAST8	"X"	/* uint_fast8_t		*/
 #define	PRIXFAST16	"X"	/* uint_fast16_t	*/
 #define	PRIXFAST32	"X"	/* uint_fast32_t	*/
+#endif
 #define	PRIXFAST64	"llX"	/* uint_fast64_t	*/
 #define	PRIXMAX		"llX"	/* uintmax_t		*/
 #define	PRIXPTR		"lX"	/* uintptr_t		*/
@@ -140,9 +176,15 @@
 #define	SCNdLEAST16	"hd"	/* int_least16_t	*/
 #define	SCNdLEAST32	"d"	/* int_least32_t	*/
 #define	SCNdLEAST64	"lld"	/* int_least64_t	*/
+#ifdef _LP64
+#define	SCNdFAST8	"ld"	/* int_fast8_t		*/
+#define	SCNdFAST16	"ld"	/* int_fast16_t		*/
+#define	SCNdFAST32	"ld"	/* int_fast32_t		*/
+#else
 #define	SCNdFAST8	"d"	/* int_fast8_t		*/
 #define	SCNdFAST16	"d"	/* int_fast16_t		*/
 #define	SCNdFAST32	"d"	/* int_fast32_t		*/
+#endif
 #define	SCNdFAST64	"lld"	/* int_fast64_t		*/
 #define	SCNdMAX		"lld"	/* intmax_t		*/
 #define	SCNdPTR		"ld"	/* intptr_t		*/
@@ -155,9 +197,15 @@
 #define	SCNiLEAST16	"hi"	/* int_least16_t	*/
 #define	SCNiLEAST32	"i"	/* int_least32_t	*/
 #define	SCNiLEAST64	"lli"	/* int_least64_t	*/
+#ifdef _LP64
+#define	SCNiFAST8	"li"	/* int_fast8_t		*/
+#define	SCNiFAST16	"li"	/* int_fast16_t		*/
+#define	SCNiFAST32	"li"	/* int_fast32_t		*/
+#else
 #define	SCNiFAST8	"i"	/* int_fast8_t		*/
 #define	SCNiFAST16	"i"	/* int_fast16_t		*/
 #define	SCNiFAST32	"i"	/* int_fast32_t		*/
+#endif
 #define	SCNiFAST64	"lli"	/* int_fast64_t		*/
 #define	SCNiMAX		"lli"	/* intmax_t		*/
 #define	SCNiPTR		"li"	/* intptr_t		*/
@@ -172,9 +220,15 @@
 #define	SCNoLEAST16	"ho"	/* uint_least16_t	*/
 #define	SCNoLEAST32	"o"	/* uint_least32_t	*/
 #define	SCNoLEAST64	"llo"	/* uint_least64_t	*/
+#ifdef _LP64
+#define	SCNoFAST8	"lo"	/* uint_fast8_t		*/
+#define	SCNoFAST16	"lo"	/* uint_fast16_t	*/
+#define	SCNoFAST32	"lo"	/* uint_fast32_t	*/
+#else
 #define	SCNoFAST8	"o"	/* uint_fast8_t		*/
 #define	SCNoFAST16	"o"	/* uint_fast16_t	*/
 #define	SCNoFAST32	"o"	/* uint_fast32_t	*/
+#endif
 #define	SCNoFAST64	"llo"	/* uint_fast64_t	*/
 #define	SCNoMAX		"llo"	/* uintmax_t		*/
 #define	SCNoPTR		"lo"	/* uintptr_t		*/
@@ -187,9 +241,15 @@
 #define	SCNuLEAST16	"hu"	/* uint_least16_t	*/
 #define	SCNuLEAST32	"u"	/* uint_least32_t	*/
 #define	SCNuLEAST64	"llu"	/* uint_least64_t	*/
+#ifdef _LP64
+#define	SCNuFAST8	"lu"	/* uint_fast8_t		*/
+#define	SCNuFAST16	"lu"	/* uint_fast16_t	*/
+#define	SCNuFAST32	"lu"	/* uint_fast32_t	*/
+#else
 #define	SCNuFAST8	"u"	/* uint_fast8_t		*/
 #define	SCNuFAST16	"u"	/* uint_fast16_t	*/
 #define	SCNuFAST32	"u"	/* uint_fast32_t	*/
+#endif
 #define	SCNuFAST64	"llu"	/* uint_fast64_t	*/
 #define	SCNuMAX		"llu"	/* uintmax_t		*/
 #define	SCNuPTR		"lu"	/* uintptr_t		*/
@@ -202,9 +262,15 @@
 #define	SCNxLEAST16	"hx"	/* uint_least16_t	*/
 #define	SCNxLEAST32	"x"	/* uint_least32_t	*/
 #define	SCNxLEAST64	"llx"	/* uint_least64_t	*/
+#ifdef _LP64
+#define	SCNxFAST8	"lx"	/* uint_fast8_t		*/
+#define	SCNxFAST16	"lx"	/* uint_fast16_t	*/
+#define	SCNxFAST32	"lx"	/* uint_fast32_t	*/
+#else
 #define	SCNxFAST8	"x"	/* uint_fast8_t		*/
 #define	SCNxFAST16	"x"	/* uint_fast16_t	*/
 #define	SCNxFAST32	"x"	/* uint_fast32_t	*/
+#endif
 #define	SCNxFAST64	"llx"	/* uint_fast64_t	*/
 #define	SCNxMAX		"llx"	/* uintmax_t		*/
 #define	SCNxPTR		"lx"	/* uintptr_t		*/

Index: src/sys/arch/arm/include/int_limits.h
diff -u src/sys/arch/arm/include/int_limits.h:1.9 src/sys/arch/arm/include/int_limits.h:1.10
--- src/sys/arch/arm/include/int_limits.h:1.9	Fri Aug 29 19:08:29 2008
+++ src/sys/arch/arm/include/int_limits.h	Wed Jan 29 01:40:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_limits.h,v 1.9 2008/08/29 19:08:29 matt Exp $	*/
+/*	$NetBSD: int_limits.h,v 1.10 2014/01/29 01:40:35 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -98,9 +98,15 @@
 
 /* 7.18.2.4 Limits of integer types capable of holding object pointers */
 
+#ifdef _LP64
+#define	INTPTR_MIN	(-0x7fffffffffffffffL-1)	/* intptr_t	  */
+#define	INTPTR_MAX	0x7fffffffffffffffL		/* intptr_t	  */
+#define	UINTPTR_MAX	0xffffffffffffffffUL		/* uintptr_t	  */
+#else
 #define	INTPTR_MIN	(-0x7fffffffL-1)		/* intptr_t	  */
 #define	INTPTR_MAX	0x7fffffffL			/* intptr_t	  */
 #define	UINTPTR_MAX	0xffffffffUL			/* uintptr_t	  */
+#endif
 
 /* 7.18.2.5 Limits of greatest-width integer types */
 
@@ -114,14 +120,23 @@
  */
 
 /* limits of ptrdiff_t */
+#ifdef _LP64
+#define	PTRDIFF_MIN	(-0x7fffffffffffffffL-1)	/* ptrdiff_t	  */
+#define	PTRDIFF_MAX	0x7fffffffffffffffL		/* ptrdiff_t	  */
+#else
 #define	PTRDIFF_MIN	(-0x7fffffffL-1)		/* ptrdiff_t	  */
 #define	PTRDIFF_MAX	0x7fffffffL			/* ptrdiff_t	  */
+#endif
 
 /* limits of sig_atomic_t */
 #define	SIG_ATOMIC_MIN	(-0x7fffffff-1)			/* sig_atomic_t	  */
 #define	SIG_ATOMIC_MAX	0x7fffffff			/* sig_atomic_t	  */
 
 /* limit of size_t */
+#ifdef _LP64
+#define	SIZE_MAX	0xffffffffffffffffUL		/* size_t	  */
+#else
 #define	SIZE_MAX	0xffffffffUL			/* size_t	  */
+#endif
 
 #endif /* !_ARM_INT_LIMITS_H_ */

Index: src/sys/arch/arm/include/int_mwgwtypes.h
diff -u src/sys/arch/arm/include/int_mwgwtypes.h:1.4 src/sys/arch/arm/include/int_mwgwtypes.h:1.5
--- src/sys/arch/arm/include/int_mwgwtypes.h:1.4	Mon Apr 28 20:23:14 2008
+++ src/sys/arch/arm/include/int_mwgwtypes.h	Wed Jan 29 01:40:35 2014
@@ -1,11 +1,11 @@
-/*	$NetBSD: int_mwgwtypes.h,v 1.4 2008/04/28 20:23:14 martin Exp $	*/
+/* $NetBSD: int_mwgwtypes.h,v 1.5 2014/01/29 01:40:35 matt Exp $ */
 
 /*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
+ * by Matt Thomas of 3am Software Foundry.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -38,49 +38,92 @@
 
 /* 7.18.1.2 Minimum-width integer types */
 
-typedef	signed char		  int_least8_t;
-typedef	unsigned char		 uint_least8_t;
-typedef	short int		 int_least16_t;
-typedef	unsigned short int	uint_least16_t;
-typedef	int			 int_least32_t;
-typedef	unsigned int		uint_least32_t;
-#ifdef __COMPILER_INT64__
-typedef	__COMPILER_INT64__	 int_least64_t;
-typedef	__COMPILER_UINT64__	uint_least64_t;
-#else
-/* LONGLONG */
-typedef	long long int		 int_least64_t;
-/* LONGLONG */
-typedef	unsigned long long int	uint_least64_t;
+#ifndef __INT_LEAST8_TYPE__
+# define __INT_LEAST8_TYPE__	signed char
+#endif
+#ifndef __UINT_LEAST8_TYPE__
+# define __UINT_LEAST8_TYPE__	unsigned char
+#endif
+#ifndef __INT_LEAST16_TYPE__
+# define __INT_LEAST16_TYPE__	short int
+#endif
+#ifndef __UINT_LEAST16_TYPE__
+# define __UINT_LEAST16_TYPE__	short unsigned int
+#endif
+#ifndef __INT_LEAST32_TYPE__
+# define __INT_LEAST32_TYPE__	int
+#endif
+#ifndef __UINT_LEAST32_TYPE__
+# define __UINT_LEAST32_TYPE__	unsigned int
 #endif
+#ifndef __INT_LEAST64_TYPE__
+# define __INT_LEAST64_TYPE__	long long int
+#endif
+#ifndef __UINT_LEAST64_TYPE__
+# define __UINT_LEAST64_TYPE__	long long unsigned int
+#endif
+
+typedef	__INT_LEAST8_TYPE__	  int_least8_t;
+typedef	__UINT_LEAST8_TYPE__	 uint_least8_t;
+typedef	__INT_LEAST16_TYPE__	 int_least16_t;
+typedef	__UINT_LEAST16_TYPE__	uint_least16_t;
+typedef	__INT_LEAST32_TYPE__	 int_least32_t;
+typedef	__UINT_LEAST32_TYPE__	uint_least32_t;
+typedef	__INT_LEAST64_TYPE__	 int_least64_t;
+typedef	__UINT_LEAST64_TYPE__	uint_least64_t;
 
 /* 7.18.1.3 Fastest minimum-width integer types */
-typedef	int			   int_fast8_t;
-typedef	unsigned int		  uint_fast8_t;
-typedef	int			  int_fast16_t;
-typedef	unsigned int		 uint_fast16_t;
-typedef	int			  int_fast32_t;
-typedef	unsigned int		 uint_fast32_t;
-#ifdef __COMPILER_INT64__
-typedef	__COMPILER_INT64__	  int_fast64_t;
-typedef	__COMPILER_UINT64__	 uint_fast64_t;
+
+#ifdef _LP64
+#define __INT_FAST_PREFIX__	long
 #else
-/* LONGLONG */
-typedef	long long int		  int_fast64_t;
-/* LONGLONG */
-typedef	unsigned long long int	 uint_fast64_t;
+#define __INT_FAST_PREFIX__
 #endif
 
+#ifndef __INT_FAST8_TYPE__
+# define __INT_FAST8_TYPE__	__INT_FAST_PREFIX__ int
+#endif
+#ifndef __UINT_FAST8_TYPE__
+# define __UINT_FAST8_TYPE__	__INT_FAST_PREFIX__ unsigned int
+#endif
+#ifndef __INT_FAST16_TYPE__
+# define __INT_FAST16_TYPE__	__INT_FAST_PREFIX__ int
+#endif
+#ifndef __UINT_FAST16_TYPE__
+# define __UINT_FAST16_TYPE__	__INT_FAST_PREFIX__ unsigned int
+#endif
+#ifndef __INT_FAST32_TYPE__
+# define __INT_FAST32_TYPE__	__INT_FAST_PREFIX__ int
+#endif
+#ifndef __UINT_FAST32_TYPE__
+# define __UINT_FAST32_TYPE__	__INT_FAST_PREFIX__ unsigned int
+#endif
+#ifndef __INT_FAST64_TYPE__
+# define __INT_FAST64_TYPE__	long long int
+#endif
+#ifndef __UINT_FAST64_TYPE__
+# define __UINT_FAST64_TYPE__	long long unsigned int
+#endif
+
+typedef	__INT_FAST8_TYPE__	   int_fast8_t;
+typedef	__UINT_FAST8_TYPE__	  uint_fast8_t;
+typedef	__INT_FAST16_TYPE__	  int_fast16_t;
+typedef	__UINT_FAST16_TYPE__	 uint_fast16_t;
+typedef	__INT_FAST32_TYPE__	  int_fast32_t;
+typedef	__UINT_FAST32_TYPE__	 uint_fast32_t;
+typedef	__INT_FAST64_TYPE__	  int_fast64_t;
+typedef	__UINT_FAST64_TYPE__	 uint_fast64_t;
+
 /* 7.18.1.5 Greatest-width integer types */
 
-#ifdef __COMPILER_INT64__
-typedef	__COMPILER_INT64__	      intmax_t;
-typedef	__COMPILER_UINT64__	     uintmax_t;
-#else
-/* LONGLONG */
-typedef	long long int		      intmax_t;
-/* LONGLONG */
-typedef	unsigned long long int	     uintmax_t;
+#ifndef __INTMAX_TYPE__
+# define __INTMAX_TYPE__	long long int
 #endif
+#ifndef __UINTMAX_TYPE__
+# define __UINTMAX_TYPE__	unsigned __INTMAX_TYPE__
+#endif
+
+typedef	__INTMAX_TYPE__	     	      intmax_t;
+typedef	__UINTMAX_TYPE__	     uintmax_t;
 
 #endif /* !_ARM_INT_MWGWTYPES_H_ */

Index: src/sys/arch/arm/include/int_types.h
diff -u src/sys/arch/arm/include/int_types.h:1.10 src/sys/arch/arm/include/int_types.h:1.11
--- src/sys/arch/arm/include/int_types.h:1.10	Wed Jan 29 00:42:15 2014
+++ src/sys/arch/arm/include/int_types.h	Wed Jan 29 01:40:35 2014
@@ -1,9 +1,12 @@
-/*	$NetBSD: int_types.h,v 1.10 2014/01/29 00:42:15 matt Exp $	*/
+/*	$NetBSD: int_types.h,v 1.11 2014/01/29 01:40:35 matt Exp $	*/
 
-/*
- * Copyright (c) 1990 The Regents of the University of California.
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -12,23 +15,18 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
  *
- *	from: @(#)types.h	7.5 (Berkeley) 3/9/91
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef	_ARM_INT_TYPES_H_
@@ -42,27 +40,37 @@
 
 /* 7.18.1.1 Exact-width integer types */
 
-typedef	signed char		 __int8_t;
-typedef	unsigned char		__uint8_t;
-typedef	short int		__int16_t;
-typedef	unsigned short int     __uint16_t;
-typedef	int			__int32_t;
-typedef	unsigned int	       __uint32_t;
-#ifdef __COMPILER_INT64__
-typedef	__COMPILER_INT64__	__int64_t;
-typedef	__COMPILER_UINT64__    __uint64_t;
-#else
-/* LONGLONG */
-typedef	long long int		__int64_t;
-/* LONGLONG */
-typedef	unsigned long long int __uint64_t;
+#ifndef __INT8_TYPE__
+# define __INT8_TYPE__		char
+#endif
+#ifndef __INT16_TYPE__
+# define __INT16_TYPE__		short int
+#endif
+#ifndef __INT32_TYPE__
+# define __INT32_TYPE__		int
 #endif
+#ifndef __INT64_TYPE__
+# define __INT64_TYPE__		long long int
+#endif
+
+typedef	signed __INT8_TYPE__		   __int8_t;
+typedef	unsigned __INT8_TYPE__		  __uint8_t;
+typedef	signed __INT16_TYPE__		  __int16_t;
+typedef	unsigned __INT16_TYPE__		 __uint16_t;
+typedef	signed __INT32_TYPE__		  __int32_t;
+typedef	unsigned __INT32_TYPE__		 __uint32_t;
+typedef	signed __INT64_TYPE__		  __int64_t;
+typedef	unsigned __INT64_TYPE__		 __uint64_t;
 
 #define	__BIT_TYPES_DEFINED__
 
 /* 7.18.1.4 Integer types capable of holding object pointers */
 
-typedef long int	       __intptr_t;
-typedef unsigned long int     __uintptr_t;
+#ifndef __INTPTR_TYPE__
+# define __INTPTR_TYPE__	long int
+#endif
+
+typedef	signed __INTPTR_TYPE__		 __intptr_t;
+typedef	unsigned __INTPTR_TYPE__	__uintptr_t;
 
 #endif	/* !_ARM_INT_TYPES_H_ */

Index: src/sys/arch/arm/include/limits.h
diff -u src/sys/arch/arm/include/limits.h:1.16 src/sys/arch/arm/include/limits.h:1.17
--- src/sys/arch/arm/include/limits.h:1.16	Wed Jan 29 00:42:15 2014
+++ src/sys/arch/arm/include/limits.h	Wed Jan 29 01:40:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.16 2014/01/29 00:42:15 matt Exp $	*/
+/*	$NetBSD: limits.h,v 1.17 2014/01/29 01:40:35 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -50,9 +50,15 @@
 #define	INT_MAX		0x7fffffff	/* max value for an int */
 #define	INT_MIN		(-0x7fffffff-1)	/* min value for an int */
 
+#ifdef _LP64
+#define	ULONG_MAX	0xffffffffffffffffUL	/* max unsigned long */
+#define	LONG_MAX	0x7fffffffffffffffL	/* max signed long */
+#define	LONG_MIN	(-0x7fffffffffffffffL-1) /* min signed long */
+#else
 #define	ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
 #define	LONG_MAX	0x7fffffffL	/* max value for a long */
 #define	LONG_MIN	(-0x7fffffffL-1)	/* min value for a long */
+#endif
 
 #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
     defined(_NETBSD_SOURCE)
@@ -77,16 +83,27 @@
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */
 
 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
+#ifdef _LP64
+#define LONG_BIT	64
+#else
 #define LONG_BIT	32
+#endif
 #define WORD_BIT	32
 
-#define DBL_DIG		15
-#define DBL_MAX		1.7976931348623157E+308
-#define DBL_MIN		2.2250738585072014E-308
-
-#define FLT_DIG		6
-#define FLT_MAX		3.40282347E+38F
-#define FLT_MIN		1.17549435E-38F
+#define DBL_DIG		__DBL_DIG__
+#define DBL_MAX		__DBL_MAX__
+#define DBL_MIN		__DBL_MIN__
+
+#define FLT_DIG		__FLT_DIG__
+#define FLT_MAX		__FLT_MAX__
+#define FLT_MIN		__FLT_MIN__
+
+#ifdef __ARM_PCS_AAPCS64
+#define LDBL_DIG	__LDBL_DIG__
+#define LDBL_MAX	__LDBL_MAX__
+#define LDBL_MIN	__LDBL_MIN__
 #endif
 
+#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
+
 #endif	/* _ARM_LIMITS_H_ */

Reply via email to