From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11900 invoked by alias); 31 Mar 2004 19:55:44 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 11780 invoked from network); 31 Mar 2004 19:55:40 -0000 Received: from unknown (HELO mgr2.xmission.com) (198.60.22.202) by sources.redhat.com with SMTP; 31 Mar 2004 19:55:40 -0000 Received: from [198.60.22.201] (helo=mgr1.xmission.com) by mgr2.xmission.com with esmtp (Exim 3.35 #1) id 1B8loG-0001e8-02; Wed, 31 Mar 2004 12:55:36 -0700 Received: from [198.60.22.20] (helo=xmission.xmission.com) by mgr1.xmission.com with esmtp (Exim 4.30) id 1B8loF-0007QE-SX; Wed, 31 Mar 2004 12:55:35 -0700 Received: from llewelly by xmission.xmission.com with local (Exim 3.35 #1 (Debian)) id 1B8loF-00006L-00; Wed, 31 Mar 2004 12:55:35 -0700 To: "Artem B. Bityuckiy" Cc: gcc-help@gcc.gnu.org References: <406B0506.3050007@yandex.ru> From: llewelly@xmission.com Date: Wed, 31 Mar 2004 21:26:00 -0000 In-Reply-To: <406B0506.3050007@yandex.ru> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Subject: Re: size of wchar_t Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on mgr1.xmission.com X-Spam-Level: X-Spam-Status: No, hits=0.8 required=8.0 tests=NO_REAL_NAME,XMSubMetaS_00 autolearn=no version=2.63 X-SA-Exim-Mail-From: llewelly@xmission.com X-SA-Exim-Version: 3.1 (built Wed Aug 20 09:38:54 PDT 2003) X-SA-Exim-Scanned: Yes X-SW-Source: 2004-03/txt/msg00357.txt.bz2 "Artem B. Bityuckiy" writes: > Hello. > > I need to determine size of wchar_t type at compile-time. What do you mean by 'compile time'? sizeof(wchar_t) is compile time constant, but it isn't availibe for preprocessor conditionals. > Is there > some macro to find sizeof(wchar_t). I can't find one. However, C99 requires and to provide WCHAR_MIN and WCHAR_MAX. You didn't say which C library you were using, but it would be easy to check. They are not quite what you want, but maybe they are close enough. > Specifically, I need to know is > wchar_t 2 bytes or more. I tried to use WCHAR_TYPE_SIZE macro but it > isn't defined by gcc (I use arm-elf-gcc, v3.2). I also want such macro > be defined on any target. [snip] The above macros are C99-specifc. :-( .