klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit df4f614e602ce528c0de4c0829c1418c6d99b64d
parent 8d305dedafcf4dc32fc6b7fa7c9fce29ff7b7bca
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Sun, 10 Apr 2011 20:53:17 -0300

Bugfix: __LINE__ macro wasn't being expanded in KUNIQUE_NAME: we need to go one level deeper (sorry, I couldn't resist the INCEPTION reference).

Diffstat:
Msrc/kobject.h | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/kobject.h b/src/kobject.h @@ -300,8 +300,11 @@ typedef struct { ((Bigint_Node *) ((cur)->next_xor_prev ^ (uintptr_t) (prev))) /* REFACTOR: move these macros somewhere else */ -#define KCONCAT(a, b) a ## b -#define KUNIQUE_NAME(prefix) KCONCAT(prefix, __LINE__) +/* NOTE: The use of the intermediate KCONCAT is needed to allow + expansion of the __LINE__ macro. */ +#define KCONCAT_(a, b) a ## b +#define KCONCAT(a, b) KCONCAT_(a, b) +#define KUNIQUE_NAME(prefix) KCONCAT(prefix, __LINE__ ) #define kbind_bigint_iter(name, bigint, be) \ Bigint_Iter KUNIQUE_NAME(iter); \