From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 6 10:04:09 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2F6C1065670 for ; Wed, 6 Jun 2012 10:04:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id B93728FC16 for ; Wed, 6 Jun 2012 10:04:09 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M5600DGTXADMS40@smtp4.clear.net.nz> for hackers@freebsd.org; Wed, 06 Jun 2012 22:04:02 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Wed, 06 Jun 2012 22:04:02 +1200 Date: Wed, 06 Jun 2012 22:03:33 +1200 From: Andrew Turner To: hackers@freebsd.org Message-id: <20120606220333.28686407@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr Cc: Subject: Wide character types X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 10:04:10 -0000 I've been working on getting the ARM EABI working with FreeBSD. As part of the EABI spec the Procedure Call Standard for the ARM Architecture (AAPCS) defines wchar_t as either an unsigned int or an unsigned short with the former as the preferred type. FreeBSD defines wchar_t as a __wchar_t, which is defined as a __ct_rune_t, which is defined as an int. wint_t and rune_t are also defined in terms of __ct_rune_t. wint_t must be a signed type as it needs to hols a WEOF which is defined as -1. The type of rune_t appears to need to be the same as wint_t as the tow* and isw* functions are defined as taking a wint_t by the documentation but __ct_rune_t in the code and compare this value against __rune_t values. My question is am I correct in thinking rune_t and wint_t should be defined as __ct_rune_t with __ct_rune_t defined as an int while wchar_t should be defined as an unsigned int in ARM EABI and defined as an int elsewhere? Andrew