From patchwork Fri Apr 15 09:44:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 610815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qmXhy0VQdz9t4b for ; Fri, 15 Apr 2016 19:45:35 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ZSwtPhlb; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=xUTN1g5mIoZb onQnGfrWnJXtiysPENByTW86jD2+ZqwO30FYMCBb3GphpgbhnWbftHC9KBWgskqH 99bPFsW/XFJ1YHNv8z82CLXSORDWITra6GCA1G2nKuICOpirw1byEPl1zaGL+iTG j+bDr0eDHxt/ia4N5d3ERI0tzEdk8o4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=c3Mw/6S6oq+webo09t ypIlf7+j0=; b=ZSwtPhlbPui+hazvbUVltLAs1SG18+ADFOq/kg/r/iKeacMlLH Ds9Bgi1UVJ3NABS50gOKQbjtN1jvlRcEvCL6XTCm8wToGB9ux1Hakgnex8y19lDl fLESp8K3df7taCzMhEt3rKfiXqlvOkf0sCj0ALtCHkx5VuhK8gwHPxDQc= Received: (qmail 110529 invoked by alias); 15 Apr 2016 09:45:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 110404 invoked by uid 89); 15 Apr 2016 09:45:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail.embedded-brains.de Received: from mail.embedded-brains.de (HELO mail.embedded-brains.de) (82.135.62.35) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 15 Apr 2016 09:44:53 +0000 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 052512A1A8E; Fri, 15 Apr 2016 11:45:12 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Y48C_PBNkK6N; Fri, 15 Apr 2016 11:45:11 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 377FC2A1858; Fri, 15 Apr 2016 11:45:11 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id U61HiQA3y8hA; Fri, 15 Apr 2016 11:45:11 +0200 (CEST) Received: from huber-linux.eb.localhost (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTP id 0D11A2A183C; Fri, 15 Apr 2016 11:45:11 +0200 (CEST) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Cc: devel@rtems.org, newlib@sourceware.org, Sebastian Huber Subject: [PATCH] Maybe change __size_t definition in ? Date: Fri, 15 Apr 2016 11:44:48 +0200 Message-Id: <1460713488-18283-1-git-send-email-sebastian.huber@embedded-brains.de> X-IsSubscribed: yes I work currently on a better FreeBSD compatibility for Newlib. For RTEMS we use the network, USB, SD/MMC stacks from FreeBSD. It would be nice to use , etc. from Newlib directly to compile FreeBSD user and kernel space files. Various FreeBSD source and header files need a typedef __size_t via . Unfortunately the GCC provided uses #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__DragonFly__) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else #define __size_t #endif and therefore defines __size_t to nothing on Newlib targets which would trash a __size_t typedef. There exists no Newlib builtin define which we could add here. As a workaround I include before in and undefine __size_t in . This works fine so far, but breaks if someone includes after the first time. This patch would address this issue, but I do not know which other issues it generates. gcc/ChangeLog 2016-04-15 Sebastian Huber * ginclude/stddef.h (__size_t): Define to __SIZE_TYPE__. --- gcc/ginclude/stddef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index d711530..8c2e22e 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -207,7 +207,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else -#define __size_t +#define __size_t __SIZE_TYPE__ #endif #ifndef __SIZE_TYPE__ #define __SIZE_TYPE__ long unsigned int