From owner-freebsd-current Fri Jan 17 12:16:06 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id MAA23193 for current-outgoing; Fri, 17 Jan 1997 12:16:06 -0800 (PST) Received: from mule1.mindspring.com (mule1.mindspring.com [204.180.128.167]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id MAA23188 for ; Fri, 17 Jan 1997 12:16:02 -0800 (PST) Received: from rlb.users.mindspring.com (user-168-121-25-139.dialup.mindspring.com [168.121.25.139]) by mule1.mindspring.com (8.8.4/8.8.4) with SMTP id PAA38692 for ; Fri, 17 Jan 1997 15:15:53 -0500 Message-ID: <32DFDDF6.41C67EA6@mindspring.com> Date: Fri, 17 Jan 1997 15:15:50 -0500 From: Ron Bolin X-Mailer: Mozilla 3.01Gold (X11; I; FreeBSD 2.2-RELEASE i386) MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: gcc compiler question Content-Type: multipart/mixed; boundary="------------446B9B3D2781E494167EB0E7" Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk This is a multi-part message in MIME format. --------------446B9B3D2781E494167EB0E7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit In trying to port cprolog to FBSD. I find the the Solaris 2.X c compiler can handle the following macro sub, but gcc can't on any platform. Does anyone have a suggestion how gcc might emulate the Solaris macro substitution? Thank's Ron See attached code -- **************************************************************************** Ron Bolin rlb@mindspring.com, http://www.mindspring.com/~rlb/ GSU: gs01rlb@panther.gsu.edu matrlbx@indigo4.cs.gsu.edu Home: 770-992-8877 **************************************************************************** --------------446B9B3D2781E494167EB0E7 Content-Type: text/plain; charset=us-ascii; name="test.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="test.c" /* Under Solaris 2.X this compiles with the proper macro substitution on savepS = savead-lcl0; to LSave [ 6 ] = savead- ( Origin [ 5 ] ); But gcc does not */ #define savepS LSave[NAreas] #define NAreas 6 /* number of work areas/stacks */ #define LocalId 5 typedef unsigned **PTR; static PTR *savead, Origin[100]; #define lcl0 (Origin[LocalId]) unsigned LSave[100]; main() { savepS = savead-lcl0; } --------------446B9B3D2781E494167EB0E7--