From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: [PATCH 08/10] cpp hygiene in the vm Date: Thu, 23 May 2013 15:31:01 +0200 Message-ID: <1369315863-15879-9-git-send-email-wingo@pobox.com> References: <1369315863-15879-1-git-send-email-wingo@pobox.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1369315944 16690 80.91.229.3 (23 May 2013 13:32:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 May 2013 13:32:24 +0000 (UTC) Cc: Andy Wingo To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 23 15:32:24 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UfVcy-0003eR-5C for guile-devel@m.gmane.org; Thu, 23 May 2013 15:32:20 +0200 Original-Received: from localhost ([::1]:49673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfVcx-0003Y9-Q0 for guile-devel@m.gmane.org; Thu, 23 May 2013 09:32:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfVci-0003Pg-0d for guile-devel@gnu.org; Thu, 23 May 2013 09:32:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfVcW-0005kb-QJ for guile-devel@gnu.org; Thu, 23 May 2013 09:32:03 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:56241 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfVcW-0005kP-Hs for guile-devel@gnu.org; Thu, 23 May 2013 09:31:52 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 467AEB4FC; Thu, 23 May 2013 09:31:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=sasl; bh=ymzQ whxP6XkgV2TxRoJgOnqx/7g=; b=CHxVQeQosIkC01069uEfIVTOH8ocRLVTlf3h Iz1kpLiRuzQxYgWV4snU1UUzxlqgAQQsO5Zz+2EVsMjERI7Vt6CKQ5mjlHrXq01E 9EaqHC1qvFbj/MTH/6Zl5CWPvAD8wqYqc4RM3jrjwqBl0UYaUPNQLJ1l8Ea7lsQO Nk1lc/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; q=dns; s=sasl; b= gpRrrCLe4nszpfU7j5cP/yqMBAnnrYAfpnUl8CodJk9qxyDz8di5eIYYw7hs97Us nqR/xYN62B5gKxsxumOGTXHDx0AI4TO5BTxCnSfXUruvkdDXJJ4pdCG8xoAE9ezf QlwgLgqVe+1pITaKQw7gO1K5TnjgmL11OwTVNDFz6ps= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 3BEB7B4FB; Thu, 23 May 2013 09:31:52 -0400 (EDT) Original-Received: from localhost.localdomain (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 61753B4FA; Thu, 23 May 2013 09:31:50 -0400 (EDT) X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369315863-15879-1-git-send-email-wingo@pobox.com> X-Pobox-Relay-ID: 207D9AAE-C3AD-11E2-A2FB-9F710E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 208.72.237.25 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16432 Archived-At: * libguile/vm-engine.c: * libguile/vm-i-scheme.c: * libguile/vm-i-system.c: CPP hygiene: the code that #defines, #undefs. Makes things cleaner given the multiple inclusion dance we do. --- libguile/vm-engine.c | 26 ++++++++++++++++++++++++++ libguile/vm-i-scheme.c | 24 ++++++++++++++++++------ libguile/vm-i-system.c | 3 +++ 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 1cd623d..4454632 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -433,8 +433,34 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs) abort (); /* never reached */ } +#undef ALIGNED_P +#undef CACHE_REGISTER +#undef CHECK_OVERFLOW +#undef FREE_VARIABLE_REF +#undef FUNC2 +#undef INIT +#undef INUM_MAX +#undef INUM_MIN +#undef jump_table +#undef LOCAL_REF +#undef LOCAL_SET +#undef NEXT +#undef NEXT_JUMP +#undef REL +#undef RETURN +#undef RETURN_ONE_VALUE +#undef RETURN_VALUE_LIST #undef RUN_HOOK #undef RUN_HOOK1 +#undef SYNC_ALL +#undef SYNC_BEFORE_GC +#undef SYNC_IP +#undef SYNC_REGISTER +#undef VARIABLE_BOUNDP +#undef VARIABLE_REF +#undef VARIABLE_SET +#undef VM_DEFINE_OP +#undef VM_INSTRUCTION_TO_LABEL #undef VM_USE_HOOKS /* diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c index c12c42b..ef3d02b 100644 --- a/libguile/vm-i-scheme.c +++ b/libguile/vm-i-scheme.c @@ -176,7 +176,6 @@ VM_DEFINE_INSTRUCTION (146, set_cdr, "set-cdr!", 0, 2, 0) * Numeric relational tests */ -#undef REL #define REL(crel,srel) \ { \ ARGS2 (x, y); \ @@ -212,18 +211,17 @@ VM_DEFINE_FUNCTION (151, ge, "ge?", 2) REL (>=, scm_geq_p); } +#undef REL + /* * Numeric functions */ /* The maximum/minimum tagged integers. */ -#undef INUM_MAX -#undef INUM_MIN #define INUM_MAX (INTPTR_MAX - 1) #define INUM_MIN (INTPTR_MIN + scm_tc2_int) -#undef FUNC2 #define FUNC2(CFUNC,SFUNC) \ { \ ARGS2 (x, y); \ @@ -357,8 +355,11 @@ VM_DEFINE_FUNCTION (155, sub1, "sub1", 1) RETURN (scm_difference (x, SCM_I_MAKINUM (1))); } -# undef ASM_ADD -# undef ASM_SUB +#undef ASM_ADD +#undef ASM_SUB +#undef FUNC2 +#undef INUM_MAX +#undef INUM_MIN VM_DEFINE_FUNCTION (156, mul, "mul", 2) { @@ -992,6 +993,17 @@ BV_FLOAT_SET (f64, ieee_double, double, 8) #undef BV_INT_SET #undef BV_FLOAT_SET +#undef ALIGNED_P +#undef VM_VALIDATE_BYTEVECTOR + +#undef VM_VALIDATE_STRUCT +#undef VM_VALIDATE_CONS + +#undef ARGS1 +#undef ARGS2 +#undef ARGS3 +#undef RETURN + /* (defun renumber-ops () "start from top of buffer and renumber 'VM_DEFINE_FOO (\n' sequences" diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index f649822..9b24c92 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -538,6 +538,9 @@ VM_DEFINE_INSTRUCTION (42, br_if_not_nil, "br-if-not-nil", 3, 0, 0) POP (x); BR (!scm_is_lisp_false (x)); } + +#undef BR + /* * Subprogram call -- 1.7.10.4