From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (unknown [172.16.44.254]) by listman.redhat.com (Postfix) with ESMTP id B16752F0CF for ; Thu, 18 Oct 2001 11:58:51 -0400 (EDT) Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id f9IFwpN14824 for ; Thu, 18 Oct 2001 11:58:51 -0400 Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f9IFwpF25310 for axp-list@listman.redhat.com; Thu, 18 Oct 2001 11:58:51 -0400 Received: from vrod.sector7.com ([207.207.41.10]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f9IFwog25303 for ; Thu, 18 Oct 2001 11:58:51 -0400 Received: from porter ([192.168.8.102]) by vrod.sector7.com (8.11.0/8.11.0) with SMTP id f9IFvpm25888 for ; Thu, 18 Oct 2001 10:57:51 -0500 Message-ID: <008401c157ed$d8fe61a0$6608a8c0@sector7.com> From: "Chris Eleveld (Sector 7 Group)" To: Subject: Re: concatenating with cpp Date: Thu, 18 Oct 2001 10:59:19 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: You want to use ANSI token pasting: #define PASTE(a, b) a##b #define DIM 4 PASTE(SOME_NAME_, DIM4) if using K&R compiler: #define PASTE(a,b) a/**/b ----- Original Message ----- From: To: "Alpha Mailing List" Sent: Thursday, October 18, 2001 9:23 AM Subject: concatenating with cpp > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dear all, > > I have a problem with the cpp. Well, I have a definition: > > #define DIM 4 > > then I need the preprocessor to concatenate "SOME_NAME_" with "DIM", ie > I want to it to return SOME_NAME_4 which is a function name. > > Thus if I type: > > SOME_VALUE_ some_operation{DIM} () > > the compiler should call: > > SOME_VALUE_4() > > Can this be done? I have read the info for cpp, and I noticed that > prescanning of variables is not done for concatenating strings. > > Thanks in advance, > > Nikos > - -- > Dr. Nikolaos A. Margaritis > Department of Physical Chemistry > National Research Centre for Physical Sciences "Demokritos" > Ag. Paraskevi, Athens 15310, Greece. > Tel: +30(0)1 650 3964 > URL: http://mmml.chem.demokritos.gr/~nmargar > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE7zuXw+7yOA19c97kRAuoTAJ9e1M8iXQuKDokOIXSMRvmyP62aggCdEB6E > sA7VbrcZBHrRX/d/Idyskvk= > =vXqi > -----END PGP SIGNATURE----- > > > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list