From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 609 invoked by alias); 22 Nov 2002 17:17:32 -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 597 invoked from network); 22 Nov 2002 17:17:29 -0000 Received: from unknown (HELO smtp-relay-1.adobe.com) (192.150.11.1) by sources.redhat.com with SMTP; 22 Nov 2002 17:17:29 -0000 Received: from inner-relay-1.corp.adobe.com (inner-relay-1 [153.32.1.51]) by smtp-relay-1.adobe.com (8.12.3/8.12.3) with ESMTP id gAMHKBw3018826 for ; Fri, 22 Nov 2002 09:20:12 -0800 (PST) Received: from iplan-mn.corp.adobe.com (iplan-mn.corp.adobe.com [130.248.25.5]) by inner-relay-1.corp.adobe.com (8.12.3/8.12.3) with ESMTP id gAMHHJKX003191 for ; Fri, 22 Nov 2002 09:17:19 -0800 (PST) Received: from mn-eljaypc.adobe.com ([130.248.190.143]) by iplan-mn.corp.adobe.com (Netscape Messaging Server 4.15 mn Jul 11 2001 16:32:57) with ESMTP id H5ZMOU00.474 for ; Fri, 22 Nov 2002 11:17:18 -0600 Message-Id: <4.3.2.7.2.20021122105625.00b525e8@iplan-mn.corp.adobe.com> X-Sender: eljay@iplan-mn.corp.adobe.com Date: Fri, 22 Nov 2002 09:17:00 -0000 To: gcc-help@gcc.gnu.org From: Eljay Love-Jensen Subject: CPP (preprocessor) quandry In-Reply-To: <015f01c2803c$f7448090$fd01a8c0@rhizome.org> References: <006201c27f9d$c23a9f50$fd01a8c0@rhizome.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-SW-Source: 2002-11/txt/msg00163.txt.bz2 Here's a simplified example of my quandry: #define MkFoo(y) typedef y Foo Users were happy with this solution, doing things like... MkFoo(unsigned char); ...or... MkFoo(signed long int); ...as they needed. But then one day, a programmer needed this. But the following is No Good... MkFoo(enum {a,b,c}); ...since the preprocessor thinks the comma belongs to it. So the usual way of embedding commas as a macro parm is by another set of parens: MkFoo((enum {a,b,c})); However, that expands to... typedef (enum {a,b,c}) Foo; ...which is still No Good. What is the preprocessor trick to strip out the extra parens? Or is there an inverse of stringification (passing the parm in as a quoted string and then stripping the quotes would be acceptable, if possible)? Don't suggest templates. Not appropriate for this code base. Thanks, --Eljay (I hate macros.)