[Pkg-gnupg-commit] [gnupg2] 232/292: gpgscm: Make the compile-hook configurable.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Nov 21 06:31:46 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit 568cfcde45a0d6c456d8f8be1ea0e408416badad
Author: Justus Winter <justus at g10code.com>
Date: Wed Nov 9 13:34:54 2016 +0100
gpgscm: Make the compile-hook configurable.
* tests/gpgscm/scheme-private.h (struct scheme): Make field
'COMPILE_HOOK' optional.
* tests/gpgscm/scheme.c (opexe_0): Fix guard.
(scheme_init_custom_alloc): Conditionally initialize 'COMPILE_HOOK'.
* tests/gpgscm/scheme.h (USE_COMPILE_HOOK): Define to 1 by default.
Signed-off-by: Justus Winter <justus at g10code.com>
---
tests/gpgscm/scheme-private.h | 2 ++
tests/gpgscm/scheme.c | 4 +++-
tests/gpgscm/scheme.h | 7 +++++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/gpgscm/scheme-private.h b/tests/gpgscm/scheme-private.h
index f5e4b0a..884889c 100644
--- a/tests/gpgscm/scheme-private.h
+++ b/tests/gpgscm/scheme-private.h
@@ -115,7 +115,9 @@ pointer FEED_TO; /* => */
pointer COLON_HOOK; /* *colon-hook* */
pointer ERROR_HOOK; /* *error-hook* */
pointer SHARP_HOOK; /* *sharp-hook* */
+#if USE_COMPILE_HOOK
pointer COMPILE_HOOK; /* *compile-hook* */
+#endif
pointer free_cell; /* pointer to top of free cells */
long fcells; /* # of free cells */
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 6daa280..884ffd5 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -2688,7 +2688,7 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) {
sc->code = sc->value;
s_goto(sc,OP_EVAL);
-#if 1
+#if USE_COMPILE_HOOK
case OP_LAMBDA: /* lambda */
/* If the hook is defined, apply it to sc->code, otherwise
set sc->value fall through */
@@ -4737,7 +4737,9 @@ int scheme_init_custom_alloc(scheme *sc, func_alloc malloc, func_dealloc free) {
sc->COLON_HOOK = mk_symbol(sc,"*colon-hook*");
sc->ERROR_HOOK = mk_symbol(sc, "*error-hook*");
sc->SHARP_HOOK = mk_symbol(sc, "*sharp-hook*");
+#if USE_COMPILE_HOOK
sc->COMPILE_HOOK = mk_symbol(sc, "*compile-hook*");
+#endif
return !sc->no_memory;
}
diff --git a/tests/gpgscm/scheme.h b/tests/gpgscm/scheme.h
index bd6cda5..8d6fb42 100644
--- a/tests/gpgscm/scheme.h
+++ b/tests/gpgscm/scheme.h
@@ -40,6 +40,7 @@ extern "C" {
# define USE_ERROR_HOOK 0
# define USE_TRACING 0
# define USE_COLON_HOOK 0
+# define USE_COMPILE_HOOK 0
# define USE_DL 0
# define USE_PLIST 0
#endif
@@ -83,6 +84,12 @@ extern "C" {
# define USE_COLON_HOOK 1
#endif
+/* Compile functions using *compile-hook*. The default hook expands
+ * macros. */
+#ifndef USE_COMPILE_HOOK
+# define USE_COMPILE_HOOK 1
+#endif
+
#ifndef USE_STRCASECMP /* stricmp for Unix */
# define USE_STRCASECMP 0
#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list