From owner-freebsd-hackers Fri Oct 27 06:08:18 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id GAA17496 for hackers-outgoing; Fri, 27 Oct 1995 06:08:18 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id GAA17487 ; Fri, 27 Oct 1995 06:08:12 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id XAA13158; Fri, 27 Oct 1995 23:04:39 +1000 Date: Fri, 27 Oct 1995 23:04:39 +1000 From: Bruce Evans Message-Id: <199510271304.XAA13158@godzilla.zeta.org.au> To: hackers@freefall.freebsd.org, hsu@freefall.freebsd.org Subject: Re: cpp question Sender: owner-hackers@FreeBSD.org Precedence: bulk >Well, if you use gcc -E or an ANSI cpp, you can use #name. If you use a 4.4BSD derived system, then you can #include (perhaps indirectly) and use __STRING(), which is supposed to hide the unportability of #name. Don't use it in portable code. __STRING() and __P(() are less portable than #name or prototypes. For portability, you should define your own macros, e.g., for ANSI: #define P__(x) x #define STR(x) STR1(x) #define STR1(x) #x STR(x) should normally be used instead of #x even if there are no portablility considerations, since STR1(x) usually does the wrong thing if x is a macro (x doesn't get expanded). The nested macro trick for STR(x) doesn't work in traditional mode and isn't used in . Bruce