Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!oliveb!sun!gorodish!guy From: guy@gorodish.UUCP Newsgroups: comp.unix.wizards Subject: Re: Concatenation with cpp. Message-ID: <18251@sun.uucp> Date: Thu, 7-May-87 01:58:28 EDT Article-I.D.: sun.18251 Posted: Thu May 7 01:58:28 1987 Date-Received: Fri, 8-May-87 05:36:16 EDT References: <7257@brl-adm.ARPA> Sender: news@sun.uucp Lines: 28 > If you want to concatenate and you do not want to be > portable, then > #define cat(x,y) x/* */y > works on many BSD systems. It will not work on SCO Xenix at all > and it sounds like it fails on SYS V too. It doesn't sound like it fails on System V at all, if you read the articles posted on this subject. In fact I just tried it on a 3B2 running S5R3.0, and it worked just fine. In case anybody didn't hear that, I'll repeat it again; IT WORKED JUST FINE ON SYSTEM V. However, the reason why it worked just fine on System V is that System V Release 3.0 as released by AT&T for the 3B2 uses the Reiser preprocessor, as do most BSD systems, and for that matter most System III, System V, and V7 systems. There is no guarantee that it will work on other systems. One possibility is to do as Arthur Olson suggested and use "#ifdef __STDC__" to select whether the ANSI C technique is to be used or the Reiser preprocessor technique is to be used. This works fine if you have an implementation that conforms to the (draft!) ANSI C standard or that uses the Reiser preprocessor or another preprocessor that works in that fashion, but it doesn't help if you have one that doesn't support the ANSI C ## operator and doesn't work like the Reiser preprocessor. If that's the case, you're on your own.