unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: 27579@debbugs.gnu.org
Subject: bug#27579: intptr_t and uintptr_t
Date: Tue, 4 Jul 2017 16:48:20 -0700	[thread overview]
Message-ID: <D7A20344-4A65-4F80-9A14-221DF2C1F38B@gmail.com> (raw)
In-Reply-To: <B847CCFA-7953-4ACF-8902-CDE1273FF5A8@gmail.com>

I found the issue.   I called the symbol intptr_t in foreign.c and intptr in foreign.scm

Now both use intptr_t and uintptr_t, with patch below.

Matt

--- libguile/foreign.c-orig	2017-07-04 15:57:55.000000000 -0700
+++ libguile/foreign.c	2017-07-04 16:02:45.000000000 -0700
@@ -56,6 +56,8 @@
 SCM_SYMBOL (sym_size_t, "size_t");
 SCM_SYMBOL (sym_ssize_t, "ssize_t");
 SCM_SYMBOL (sym_ptrdiff_t, "ptrdiff_t");
+SCM_SYMBOL (sym_intptr_t, "intptr_t");
+SCM_SYMBOL (sym_uintptr_t, "uintptr_t");
 
 /* that's for pointers, you know. */
 SCM_SYMBOL (sym_asterisk, "*");
@@ -1248,6 +1250,26 @@
 #endif
 	      );
 
+  scm_define (sym_intptr_t,
+#if SCM_SIZEOF_INTPTR_T == 8
+	      scm_from_uint8 (SCM_FOREIGN_TYPE_INT64)
+#elif SCM_SIZEOF_INTPTR_T == 4
+	      scm_from_uint8 (SCM_FOREIGN_TYPE_INT32)
+#else
+# error unsupported sizeof (scm_t_intptr)
+#endif
+	      );
+
+  scm_define (sym_uintptr_t,
+#if SCM_SIZEOF_UINTPTR_T == 8
+	      scm_from_uint8 (SCM_FOREIGN_TYPE_UINT64)
+#elif SCM_SIZEOF_UINTPTR_T == 4
+	      scm_from_uint8 (SCM_FOREIGN_TYPE_UINT32)
+#else
+# error unsupported sizeof (scm_t_uintptr)
+#endif
+	      );
+
   null_pointer = scm_cell (scm_tc7_pointer, 0);
   scm_define (sym_null, null_pointer);
 }
--- module/system/foreign.scm-orig	2017-07-04 16:06:15.000000000 -0700
+++ module/system/foreign.scm	2017-07-04 16:44:27.000000000 -0700
@@ -30,6 +30,7 @@
             uint16 int16
             uint32 int32
             uint64 int64
+            intptr_t uintptr_t
 
             sizeof alignof
 






  parent reply	other threads:[~2017-07-04 23:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 23:38 bug#27579: [patch] add intptr uintptr to (system foreign) Matt Wette
2017-07-04 23:43 ` bug#27579: Intptr and uintptr Matt Wette
2017-07-04 23:48 ` Matt Wette [this message]
2017-11-22 15:35   ` bug#27579: intptr_t and uintptr_t Ludovic Courtès
2017-08-04 22:51 ` bug#27579: System foreign Matt Wette
2017-11-18 16:38 ` bug#27579: wchar_t needed also Matt Wette

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D7A20344-4A65-4F80-9A14-221DF2C1F38B@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=27579@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).