From 753612fc80d5cc885147f19d09ab9c64c470d50a Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 13 Dec 2011 17:34:47 +0000 Subject: Add support for __COUNTER__. __COUNTER__ allows one to obtain incrementing (read: unique) numbers from the C preprocesor. This is useful when implementing things like a robust implementation of CTASSERT(), which currently fails when using it more than once on a single line of code. Probably not likely to cause any breakage, but still. __COUNTER__ was also added to GCC 4.3, but since that implementation is GPLv3 licensed, I took the liberty of implementing it without looking at any upstream sources. Therefore, this version is licensed under the same license as the rest of the code; GPLv2. --- contrib/gcclibs/libcpp/init.c | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/gcclibs/libcpp/init.c') diff --git a/contrib/gcclibs/libcpp/init.c b/contrib/gcclibs/libcpp/init.c index 4330f88..8280f2f 100644 --- a/contrib/gcclibs/libcpp/init.c +++ b/contrib/gcclibs/libcpp/init.c @@ -308,6 +308,7 @@ static const struct builtin builtin_array[] = B("__BASE_FILE__", BT_BASE_FILE), B("__LINE__", BT_SPECLINE), B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL), + B("__COUNTER__", BT_COUNTER), /* Keep builtins not used for -traditional-cpp at the end, and update init_builtins() if any more are added. */ B("_Pragma", BT_PRAGMA), -- cgit v1.1