1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

Add 'scm_to_uintptr_t' and 'scm_from_uintptr_t'.

* libguile/numbers.h (scm_to_uintptr_t, scm_from_uintptr_t): New
macros.
* doc/ref/api-data.texi (Integers): Document them.
* NEWS: Mention it.
This commit is contained in:
Ludovic Courtès 2016-10-11 10:55:23 +02:00
parent 2456089116
commit 79bac3bf31
3 changed files with 17 additions and 1 deletions

View file

@ -528,6 +528,18 @@ SCM_API SCM scm_from_mpz (mpz_t rop);
#endif
#endif
#if SCM_SIZEOF_UINTPTR_T == 4
#define scm_to_uintptr_t scm_to_uint32
#define scm_from_uintptr_t scm_from_uint32
#else
#if SCM_SIZEOF_UINTPTR_T == 8
#define scm_to_uintptr_t scm_to_uint64
#define scm_from_uintptr_t scm_from_uint64
#else
#error sizeof(scm_t_uintptr) is not 4 or 8.
#endif
#endif
#if SCM_SIZEOF_SCM_T_PTRDIFF == 4
#define scm_to_ptrdiff_t scm_to_int32
#define scm_from_ptrdiff_t scm_from_int32