summaryrefslogtreecommitdiff
path: root/srfi/srfi-14.h
diff options
context:
space:
mode:
authorMartin Grabmüller <mgrabmue@cs.tu-berlin.de>2001-07-17 05:35:51 +0000
committerMartin Grabmüller <mgrabmue@cs.tu-berlin.de>2001-07-17 05:35:51 +0000
commit2671725a6539221f4bb34029bcdc3714ff901dc7 (patch)
treef4520503c14dfe6c017e9f5b9c790723aca87c36 /srfi/srfi-14.h
parent8d4ab69245bb9dea59f2bda672c7d995789e7f81 (diff)
downloadguile-2671725a6539221f4bb34029bcdc3714ff901dc7.tar.gz
* srfi-14.c: Fix for bug caused by brain-malfunctioning on my
side. Bit sets were handled wrong because I couldn't tell bit counts from byte counts. Also, the bit array should be 256 / 8 bytes long. Thank you, Gary! Removed unnecessary protoype for scm_char_set_copy.
Diffstat (limited to 'srfi/srfi-14.h')
-rw-r--r--srfi/srfi-14.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/srfi/srfi-14.h b/srfi/srfi-14.h
index 40b355236..2621ba22f 100644
--- a/srfi/srfi-14.h
+++ b/srfi/srfi-14.h
@@ -48,8 +48,15 @@
#define SCM_CHARSET_SIZE 256
+/* We expect 8-bit bytes here. Shoule be no problem in the year
+ 2001. */
+#ifndef SCM_BITS_PER_LONG
+# define SCM_BITS_PER_LONG (sizeof (long) * 8)
+#endif
+
#define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\
- [(idx) / sizeof (long)] & (1 << ((idx) % sizeof (long))))
+ [(idx) / SCM_BITS_PER_LONG] &\
+ (1 << ((idx) % SCM_BITS_PER_LONG)))
#define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset))