From b36231255f090088ffd87a4b7143a3a3df720b68 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 9 Aug 2009 23:30:50 +0200 Subject: [PATCH] Change `SCM_GC_BYTEVECTOR' to `SCM_R6RS_GC_BYTEVECTOR'. This allows compilation with Guile >= 1.9.1 (which provides its own copy of this code). --- src/bytevector.c | 10 +++++----- src/bytevector.h | 2 +- src/ports.c | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/bytevector.c b/src/bytevector.c index 5bc44c9..b2c5339 100644 --- a/src/bytevector.c +++ b/src/bytevector.c @@ -197,7 +197,7 @@ make_bytevector (unsigned len) signed char *contents = NULL; if (!SCM_R6RS_BYTEVECTOR_INLINEABLE_SIZE_P (len)) - contents = (signed char *) scm_gc_malloc (len, SCM_GC_BYTEVECTOR); + contents = (signed char *) scm_gc_malloc (len, SCM_R6RS_GC_BYTEVECTOR); bv = make_bytevector_from_buffer (len, contents); } @@ -227,7 +227,7 @@ scm_r6rs_c_take_bytevector (signed char *contents, unsigned len) bv = make_bytevector (len); c_bv = SCM_R6RS_BYTEVECTOR_CONTENTS (bv); memcpy (c_bv, contents, len); - scm_gc_free (contents, len, SCM_GC_BYTEVECTOR); + scm_gc_free (contents, len, SCM_R6RS_GC_BYTEVECTOR); } else bv = make_bytevector_from_buffer (len, contents); @@ -255,13 +255,13 @@ scm_r6rs_i_shrink_bytevector (SCM bv, unsigned c_new_len) /* Copy to the in-line buffer and free the current buffer. */ c_new_bv = SCM_R6RS_BYTEVECTOR_CONTENTS (bv); memcpy (c_new_bv, c_bv, c_new_len); - scm_gc_free (c_bv, c_len, SCM_GC_BYTEVECTOR); + scm_gc_free (c_bv, c_len, SCM_R6RS_GC_BYTEVECTOR); } else { /* Resize the existing buffer. */ c_new_bv = scm_gc_realloc (c_bv, c_len, c_new_len, - SCM_GC_BYTEVECTOR); + SCM_R6RS_GC_BYTEVECTOR); SCM_R6RS_BYTEVECTOR_SET_CONTENTS (bv, c_new_bv); } } @@ -311,7 +311,7 @@ SCM_SMOB_FREE (scm_tc16_r6rs_bytevector, free_bytevector, bv) c_bv = SCM_R6RS_BYTEVECTOR_CONTENTS (bv); c_len = SCM_R6RS_BYTEVECTOR_LENGTH (bv); - scm_gc_free (c_bv, c_len, SCM_GC_BYTEVECTOR); + scm_gc_free (c_bv, c_len, SCM_R6RS_GC_BYTEVECTOR); } return 0; diff --git a/src/bytevector.h b/src/bytevector.h index aff6a6e..f6b8bea 100644 --- a/src/bytevector.h +++ b/src/bytevector.h @@ -117,7 +117,7 @@ SCM_API SCM scm_r6rs_utf32_to_string (SCM, SCM); (SCM_R6RS_BYTEVECTOR_INLINEABLE_SIZE_P (SCM_R6RS_BYTEVECTOR_LENGTH (_bv))) /* Hint that is passed to `scm_gc_malloc ()' and friends. */ -#define SCM_GC_BYTEVECTOR "r6rs-bytevector" +#define SCM_R6RS_GC_BYTEVECTOR "r6rs-bytevector" SCM_API scm_t_bits scm_tc16_r6rs_bytevector; SCM_API SCM scm_r6rs_c_take_bytevector (signed char *, unsigned); diff --git a/src/ports.c b/src/ports.c index 079d50a..f8d1b14 100644 --- a/src/ports.c +++ b/src/ports.c @@ -595,7 +595,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_some, "get-bytevector-some", 1, 0, 0, SCM_VALIDATE_R6RS_BINARY_INPUT_PORT (1, port); c_len = 4096; - c_bv = (char *) scm_gc_malloc (c_len, SCM_GC_BYTEVECTOR); + c_bv = (char *) scm_gc_malloc (c_len, SCM_R6RS_GC_BYTEVECTOR); c_total = 0; do @@ -606,7 +606,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_some, "get-bytevector-some", 1, 0, 0, { /* Grow the bytevector. */ c_bv = (char *) scm_gc_realloc (c_bv, c_len, c_len * 2, - SCM_GC_BYTEVECTOR); + SCM_R6RS_GC_BYTEVECTOR); c_len *= 2; } @@ -624,7 +624,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_some, "get-bytevector-some", 1, 0, 0, if (c_total == 0) { result = SCM_EOF_VAL; - scm_gc_free (c_bv, c_len, SCM_GC_BYTEVECTOR); + scm_gc_free (c_bv, c_len, SCM_R6RS_GC_BYTEVECTOR); } else { @@ -632,7 +632,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_some, "get-bytevector-some", 1, 0, 0, { /* Shrink the bytevector. */ c_bv = (char *) scm_gc_realloc (c_bv, c_len, c_total, - SCM_GC_BYTEVECTOR); + SCM_R6RS_GC_BYTEVECTOR); c_len = (unsigned) c_total; } @@ -659,7 +659,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_all, "get-bytevector-all", 1, 0, 0, SCM_VALIDATE_R6RS_BINARY_INPUT_PORT (1, port); c_len = c_count = 4096; - c_bv = (char *) scm_gc_malloc (c_len, SCM_GC_BYTEVECTOR); + c_bv = (char *) scm_gc_malloc (c_len, SCM_R6RS_GC_BYTEVECTOR); c_total = c_read = 0; do @@ -668,7 +668,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_all, "get-bytevector-all", 1, 0, 0, { /* Grow the bytevector. */ c_bv = (char *) scm_gc_realloc (c_bv, c_len, c_len * 2, - SCM_GC_BYTEVECTOR); + SCM_R6RS_GC_BYTEVECTOR); c_count = c_len; c_len *= 2; } @@ -683,7 +683,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_all, "get-bytevector-all", 1, 0, 0, if (c_total == 0) { result = SCM_EOF_VAL; - scm_gc_free (c_bv, c_len, SCM_GC_BYTEVECTOR); + scm_gc_free (c_bv, c_len, SCM_R6RS_GC_BYTEVECTOR); } else { @@ -691,7 +691,7 @@ SCM_DEFINE (scm_r6rs_get_bytevector_all, "get-bytevector-all", 1, 0, 0, { /* Shrink the bytevector. */ c_bv = (char *) scm_gc_realloc (c_bv, c_len, c_total, - SCM_GC_BYTEVECTOR); + SCM_R6RS_GC_BYTEVECTOR); c_len = (unsigned) c_total; } -- 2.11.4.GIT