diff options
author | Andy Wingo <wingo@pobox.com> | 2022-01-06 21:15:16 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2022-01-13 09:37:17 +0100 |
commit | 106c5de5fc3a4858f36a7acdd67f369e21dcee01 (patch) | |
tree | 3fc246db1d6ff211e03bc67e974023732ef787fc | |
parent | 1802ed17b367be95be5e9f562624ad518f35b1c3 (diff) | |
download | guile-106c5de5fc3a4858f36a7acdd67f369e21dcee01.tar.gz |
Implement scm_{to,from}_wchar inline
* libguile/numbers.c (scm_to_wchar, scm_from_wchar): Implement inline.
-rw-r--r-- | libguile/numbers.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libguile/numbers.c b/libguile/numbers.c index 9ea860600..10efb303a 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -7072,13 +7072,17 @@ scm_from_uint64 (uint64_t arg) return scm_integer_from_uint64 (arg); } -#define TYPE scm_t_wchar -#define TYPE_MIN (int32_t)-1 -#define TYPE_MAX (int32_t)0x10ffff -#define SIZEOF_TYPE 4 -#define SCM_TO_TYPE_PROTO(arg) scm_to_wchar (arg) -#define SCM_FROM_TYPE_PROTO(arg) scm_from_wchar (arg) -#include "conv-integer.i.c" +wchar_t +scm_to_wchar (SCM arg) +{ + return inum_in_range (arg, -1, 0x10ffff); +} + +SCM +scm_from_wchar (wchar_t arg) +{ + return SCM_I_MAKINUM (arg); +} void scm_to_mpz (SCM val, mpz_t rop) |