From xemacs-m  Tue Jul 22 04:41:01 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id EAA29920
	for <xemacs-beta@xemacs.org>; Tue, 22 Jul 1997 04:41:00 -0500 (CDT)
Received: from Eng.Sun.COM ([129.146.1.25]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id DAA01025; Tue, 22 Jul 1997 03:10:06 -0700
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id CAA03380; Tue, 22 Jul 1997 02:40:31 -0700
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id CAA25785; Tue, 22 Jul 1997 02:40:29 -0700
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id CAA14786; Tue, 22 Jul 1997 02:40:27 -0700
Date: Tue, 22 Jul 1997 02:40:27 -0700
Message-Id: <199707220940.CAA14786@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Axel Seibert <aseibert@cybernet-ag.net>
Cc: xemacs-beta@xemacs.org
Subject: patch for emacs.c under NEXTSTEP
In-Reply-To: <199707201626.SAA23431@sol1.cybernet-ag.net>
References: <199707201626.SAA23431@sol1.cybernet-ag.net>
X-Mailer: VM 6.32 under 20.3 "Sofia" XEmacs  Lucid (beta9)
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

>>>>> "Axel" == Axel Seibert <aseibert@cybernet-ag.net> writes:

It amazes me that any ansi compiler would have problems with the
multiple paste trick, but we don't really need to do it at all.
The following simplification (in next beta) should fix this.

--- src/emacs.c.old
+++ src/emacs.c
@@ -451,10 +451,7 @@
 }
 
 /* Make stack traces always identify version + configuration */
-/* C makes this bizarre circumlocution necessary. */
-#define PASTE_1(x,y) PASTE_2(x,y)
-#define PASTE_2(x,y) x##y
-#define main_1 PASTE_1(main_, CANONICAL_VERSION)
+#define main_1 CANONICAL_VERSION
 
 static DOESNT_RETURN
 main_1 (int argc, char **argv, char **envp)


Command /usr/ccs/bin/sccs get -k -s -p src/emacs.c | gnudiff -U3 --label=src/emacs.c.old - --label=src/emacs.c src/emacs.c failed: rc=1

Axel> Hi!
Axel> The problems under NEXTSTEP are not sed related, but seem to be a bug
Axel> in NeXT's version of gcc (or in gcc 2.2.2 itself). The following
Axel> patch solves the problem:

Axel> diff -c src/emacs.c.orig src/emacs.c
Axel> *** src/emacs.c.orig    Sun Jul 20 17:46:01 1997
Axel> --- src/emacs.c Sun Jul 20 18:14:05 1997
Axel> ***************
Axel> *** 452,459 ****
Axel> --- 452,463 ----
  
Axel>   /* Make stack traces always identify version + configuration */
Axel>   /* C makes this bizarre circumlocution necessary. */
Axel> + #ifdef NeXT
Axel> + #define PASTE_1(x,y) x##y
Axel> + #else
Axel>   #define PASTE_1(x,y) PASTE_2(x,y)
Axel>   #define PASTE_2(x,y) x##y
Axel> + #endif
Axel>   #define main_1 PASTE_1(main_, CANONICAL_VERSION)
  
Axel>   static DOESNT_RETURN

Axel> I guess, the two passes with PASTE_1 and PASTE_2 are necesary for some
Axel> other platforms, that's why I added an #ifdef NeXT. We can't get rid
Axel> of this PASTE_1/PASTE_2 generally, can we?

Axel> Thanx for all your help, anyway!
Axel> Axel


