From patchwork Wed Jun 6 16:38:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rbmj X-Patchwork-Id: 163398 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]) by ozlabs.org (Postfix) with SMTP id DFD18B6FA4 for ; Thu, 7 Jun 2012 02:39:34 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1339605575; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-id:Date:From:User-Agent:MIME-version:To:Cc:Subject: References:In-reply-to:Content-type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=2zx0aUNz7H/JUhlReldUshsgaGY=; b=QFNpgT9CI8XxK4d 8QSl7ur5PXTom5/ThVXpOw7omtKIlK4PC7ZImcsBmQuf5WFgGvz47ES4vkZ82fEh LN5nLEtn3kcpbh2301l7KI3eVIy55vF7FTHqia+f9mfxfd6Fy4xwQA9Ys0hCR7gv ALCYknX+ycwuCBkV3otQkEiKSKSE= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-id:Date:From:User-Agent:MIME-version:To:Cc:Subject:References:In-reply-to:Content-type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TEvRPfmJ4EcNhkv9Y3KlK5P/BkSVcmXjONxng2xZzCrIdcmEojvebfl1VkvhNG 2hB7XBn9SNOGG9tIukq/Xc4yd6tbTiwipfx0Qu5u3R5UrO5ohmXDO7sFzEBTijKj PMaJF6OuX0fweX3hXQUXO66yJ4ghRBEpsBCaT9kk30SQs=; Received: (qmail 23149 invoked by alias); 6 Jun 2012 16:39:30 -0000 Received: (qmail 23139 invoked by uid 22791); 6 Jun 2012 16:39:29 -0000 X-SWARE-Spam-Status: No, hits=3.3 required=5.0 tests=AWL, BAYES_50, BOTNET, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from vms173011pub.verizon.net (HELO vms173011pub.verizon.net) (206.46.173.11) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jun 2012 16:39:17 +0000 Received: from [10.97.33.69] ([unknown] [151.188.105.156]) by vms173011.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0M5700NPOFKD2DTO@vms173011.mailsrvcs.net> for gcc-patches@gcc.gnu.org; Wed, 06 Jun 2012 11:38:38 -0500 (CDT) Message-id: <4FCF878E.10007@verizon.net> Date: Wed, 06 Jun 2012 12:38:38 -0400 From: rbmj User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-version: 1.0 To: gcc-patches@gcc.gnu.org Cc: nathan@codesourcery.com, bkorb@gnu.org Subject: [PATCH 6/7] Add hack for ioctl() on VxWorks. References: <4FCF863E.6090400@verizon.net> In-reply-to: <4FCF863E.6090400@verizon.net> Content-type: multipart/mixed; boundary=------------020803070805040700040404 X-IsSubscribed: yes 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 ioctl() is supposed to be variadic, but VxWorks only has a three argument version with the third argument of type int. This messes up when the third argument is not implicitly convertible to int. This adds a macro which wraps around ioctl() and explicitly casts the third argument to an int. Changes: * fixincludes/inclhack.def: Added vxworks_ioctl_macro fix --- fixincludes/inclhack.def | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) From 3a52d77fdbf4c422a1e641402794ce8eda47f410 Mon Sep 17 00:00:00 2001 From: rbmj Date: Mon, 4 Jun 2012 14:16:26 -0400 Subject: [PATCH 6/7] Add hack for ioctl() on VxWorks. ioctl() is supposed to be variadic, but VxWorks only has a three argument version with the third argument of type int. This messes up when the third argument is not implicitly convertible to int. This adds a macro which wraps around ioctl() and explicitly casts the third argument to an int. Changes: * fixincludes/inclhack.def: Added vxworks_ioctl_macro fix --- fixincludes/inclhack.def | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index a258f10..7863dbe 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -4440,6 +4440,22 @@ fix = { "#endif /* __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__ */\n"; }; +/* + * Wrap VxWorks ioctl to keep everything pretty + */ +fix = { + hackname = vxworks_ioctl_macro; + files = ioLib.h; + mach = "*-*-vxworks*"; + + c_fix = format; + c_fix_arg = "%0\n" + "#define ioctl(fd, func, arg) ((ioctl)((fd), (func), ((int)(arg))))\n"; + c_fix_arg = "extern[\t ]+int[\t ]+ioctl[\t ]*\([\t ,[:alnum:]]\);"; + + test_text = "extern int ioctl ( int asdf1234, int jkl , int qwerty ) ;"; +}; + /* * Fix VxWorks to not require including . -- 1.7.5.4