__CONCAT does token pasting, not string concatnation. if something like:

__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that.  It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
This commit is contained in:
cgd 2000-12-20 01:03:16 +00:00
parent 30b3e4f5c7
commit 9725bb291b

View File

@ -1,4 +1,4 @@
/* $NetBSD: calendar.c,v 1.23 2000/11/29 15:29:51 christos Exp $ */
/* $NetBSD: calendar.c,v 1.24 2000/12/20 01:03:16 cgd Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)calendar.c 8.4 (Berkeley) 1/7/95";
#endif
__RCSID("$NetBSD: calendar.c,v 1.23 2000/11/29 15:29:51 christos Exp $");
__RCSID("$NetBSD: calendar.c,v 1.24 2000/12/20 01:03:16 cgd Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -344,7 +344,7 @@ opencal()
(void)close(pdes[1]);
}
(void)close(pdes[0]);
execl(_PATH_CPP, "cpp", "-P", "-I.", __CONCAT("-I",_PATH_CALENDARS), NULL);
execl(_PATH_CPP, "cpp", "-P", "-I.", "-I" _PATH_CALENDARS, NULL);
warn("execl: %s", _PATH_CPP);
_exit(1);
}