From owner-freebsd-hackers Thu Oct 26 13:47:34 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA23958 for hackers-outgoing; Thu, 26 Oct 1995 13:47:34 -0700 Received: from bacchus.eng.umd.edu (bacchus.eng.umd.edu [129.2.94.5]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA23953 for ; Thu, 26 Oct 1995 13:47:28 -0700 Received: from espresso.eng.umd.edu (espresso.eng.umd.edu [129.2.98.13]) by bacchus.eng.umd.edu (8.7/8.7) with ESMTP id QAA14280; Thu, 26 Oct 1995 16:47:25 -0400 (EDT) Received: (chuckr@localhost) by espresso.eng.umd.edu (8.7/8.6.4) id QAA16791; Thu, 26 Oct 1995 16:47:23 -0400 (EDT) Date: Thu, 26 Oct 1995 16:47:21 -0400 (EDT) From: Chuck Robey X-Sender: chuckr@espresso.eng.umd.edu To: Poul-Henning Kamp cc: hackers@freebsd.org Subject: Re: cpp question In-Reply-To: <673.814700238@critter.tfs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org Precedence: bulk On Thu, 26 Oct 1995, Poul-Henning Kamp wrote: > > My new testament is at home, can somebody tell me in the meantime: > > What do I write in a macro to make a token a string ? > > I want to do something like this: > > #define FOO(ptr,fmt,name) \ > printf("%s =" fmt "\n", XXXX, (ptr)->name) > > What do I need to put at XXXX ? to convert the name to "name" ? Testament (H&S), page 41: #define TEST(a,b) printf( #a "<" #b "=%d\n", (a)<(b) ) TEST(0,0xFFFF); becomes printf("0<0xFFFF=%d\n", (0)<(0xFFFF)) ); > > Thanks in advance, > -- > Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. > http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. > whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. > Just that: dried leaves in boiling water ? > ========================================================================== Chuck Robey chuckr@eng.umd.edu, I run FreeBSD-current on n3lxx + Journey2 Three Accounts for the Super-users in the sky, Seven for the Operators in their halls of fame, Nine for Ordinary Users doomed to crie, One for the Illegal Cracker with his evil game In the Domains of Internet where the data lie. One Account to rule them all, One Account to watch them, One Account to make them all and in the network bind them.