From owner-svn-src-projects@FreeBSD.ORG Thu Jul 28 09:27:02 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4783C106566B; Thu, 28 Jul 2011 09:27:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 378008FC13; Thu, 28 Jul 2011 09:27:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6S9R2ZZ094270; Thu, 28 Jul 2011 09:27:02 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6S9R2iE094264; Thu, 28 Jul 2011 09:27:02 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201107280927.p6S9R2iE094264@svn.freebsd.org> From: Andrew Turner Date: Thu, 28 Jul 2011 09:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224472 - in projects/arm_eabi: include sys/arm/include sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:27:02 -0000 Author: andrew Date: Thu Jul 28 09:27:01 2011 New Revision: 224472 URL: http://svn.freebsd.org/changeset/base/224472 Log: Add support for an unsigned wchar_t required by the ARM EABI. To do this I have: * Moved the wchar_t typedef to machine/_types.h * Moved the definitions of WCHAR_MIN and WCHAR_MAX to machine/_wchar.h Added: projects/arm_eabi/sys/arm/include/_wchar.h Modified: projects/arm_eabi/include/wchar.h projects/arm_eabi/sys/arm/include/_stdint.h projects/arm_eabi/sys/arm/include/_types.h projects/arm_eabi/sys/sys/_types.h Modified: projects/arm_eabi/include/wchar.h ============================================================================== --- projects/arm_eabi/include/wchar.h Thu Jul 28 03:11:12 2011 (r224471) +++ projects/arm_eabi/include/wchar.h Thu Jul 28 09:27:01 2011 (r224472) @@ -64,6 +64,7 @@ #include #include #include +#include #include <_ctype.h> #ifndef _MBSTATE_T_DECLARED @@ -88,11 +89,6 @@ typedef __wint_t wint_t; #define _WINT_T_DECLARED #endif -#ifndef WCHAR_MIN -#define WCHAR_MIN __INT_MIN -#define WCHAR_MAX __INT_MAX -#endif - #ifndef WEOF #define WEOF ((wint_t)-1) #endif Modified: projects/arm_eabi/sys/arm/include/_stdint.h ============================================================================== --- projects/arm_eabi/sys/arm/include/_stdint.h Thu Jul 28 03:11:12 2011 (r224471) +++ projects/arm_eabi/sys/arm/include/_stdint.h Thu Jul 28 09:27:01 2011 (r224472) @@ -52,6 +52,8 @@ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#include + /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types @@ -149,12 +151,6 @@ /* Limit of size_t. */ #define SIZE_MAX UINT32_MAX -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Modified: projects/arm_eabi/sys/arm/include/_types.h ============================================================================== --- projects/arm_eabi/sys/arm/include/_types.h Thu Jul 28 03:11:12 2011 (r224471) +++ projects/arm_eabi/sys/arm/include/_types.h Thu Jul 28 09:27:01 2011 (r224472) @@ -120,4 +120,10 @@ typedef char * __va_list; typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ #endif +#ifdef __ARM_EABI__ +typedef unsigned int __wchar_t; +#else +typedef int __wchar_t; +#endif + #endif /* !_MACHINE__TYPES_H_ */ Added: projects/arm_eabi/sys/arm/include/_wchar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/arm_eabi/sys/arm/include/_wchar.h Thu Jul 28 09:27:01 2011 (r224472) @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE__WCHAR_H_ +#define _MACHINE__WCHAR_H_ + +/* + * Limits of wchar_t. __UINT_MAX and __INT_{MIN,MAX} are used as UINT32_MAX + * and INT32_{MIN,MAX} are not always defined when this is included. + */ +#ifdef __ARM_EABI__ +#define WCHAR_MIN (0) +#define WCHAR_MAX __UINT_MAX +#else +#define WCHAR_MIN __INT_MIN +#define WCHAR_MAX __INT_MAX +#endif + +#endif /* _ARM_INCLUDE__WCHAR_H_ */ + Modified: projects/arm_eabi/sys/sys/_types.h ============================================================================== --- projects/arm_eabi/sys/sys/_types.h Thu Jul 28 03:11:12 2011 (r224471) +++ projects/arm_eabi/sys/sys/_types.h Thu Jul 28 09:27:01 2011 (r224472) @@ -86,7 +86,6 @@ typedef int __cpusetid_t; /* cpuset ide */ typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __rune_t; /* rune_t (see above) */ -typedef __ct_rune_t __wchar_t; /* wchar_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ typedef __uint32_t __dev_t; /* device number */