guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-80-g3a3bea


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-80-g3a3bea7
Date: Sat, 02 Feb 2013 09:13:57 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3a3bea729fa25d1351d070160a65db5e9445ebc1

The branch, stable-2.0 has been updated
       via  3a3bea729fa25d1351d070160a65db5e9445ebc1 (commit)
       via  7facc08a80149bae4f973c07b30b56e3ae945be7 (commit)
       via  bcc7e238c9c88221752ebfe09c62a149d40cbe08 (commit)
      from  e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3a3bea729fa25d1351d070160a65db5e9445ebc1
Author: Mark H Weaver <address@hidden>
Date:   Sat Feb 2 04:04:49 2013 -0500

    Add foreign types: ssize_t and ptrdiff_t.
    
    * libguile/foreign.c (sym_ssize_t, sym_ptrdiff_t): New symbols.
      (scm_init_foreign): Add bindings for ssize_t and ptrdiff_t.
    
    * module/system/foreign.scm: Export ssize_t and ptrdiff_t.
    
    * doc/ref/api-foreign.texi (Foreign Types): Add docs.

commit 7facc08a80149bae4f973c07b30b56e3ae945be7
Author: Mark H Weaver <address@hidden>
Date:   Sat Feb 2 04:02:24 2013 -0500

    Add scm_from_ptrdiff_t and scm_to_ptrdiff_t.
    
    * libguile/numbers.h (scm_from_ptrdiff_t, scm_to_ptrdiff_t):
      New macros (function aliases).
    
    * doc/ref/api-data.texi: Add docs.

commit bcc7e238c9c88221752ebfe09c62a149d40cbe08
Author: Mark H Weaver <address@hidden>
Date:   Sat Feb 2 03:57:17 2013 -0500

    Fix typo in comment generated by gen-scmconfig.c.
    
    * libguile/gen-scmconfig.c (main): Fix typo in generated comment.

-----------------------------------------------------------------------

Summary of changes:
 doc/ref/api-data.texi     |    6 ++++--
 doc/ref/api-foreign.texi  |    2 ++
 libguile/foreign.c        |   24 +++++++++++++++++++++++-
 libguile/gen-scmconfig.c  |    2 +-
 libguile/numbers.h        |   15 ++++++++++++++-
 module/system/foreign.scm |    4 ++--
 6 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi
index 21398f4..3db7d6f 100644
--- a/doc/ref/api-data.texi
+++ b/doc/ref/api-data.texi
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 
2007, 2008, 2009, 2010, 2011, 2012, 2013
address@hidden   Free Software Foundation, Inc.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 
2007,
address@hidden   2008, 2009, 2010, 2011, 2012, 2013  Free Software Foundation, 
Inc.
 @c See the file guile.texi for copying conditions.
 
 @node Simple Data Types
@@ -414,6 +414,7 @@ function will always succeed and will always return an 
exact number.
 @deftypefnx {C Function} {unsigned long long} scm_to_ulong_long (SCM x)
 @deftypefnx {C Function} size_t scm_to_size_t (SCM x)
 @deftypefnx {C Function} ssize_t scm_to_ssize_t (SCM x)
address@hidden {C Function} scm_t_ptrdiff scm_to_ptrdiff_t (SCM x)
 @deftypefnx {C Function} scm_t_int8 scm_to_int8 (SCM x)
 @deftypefnx {C Function} scm_t_uint8 scm_to_uint8 (SCM x)
 @deftypefnx {C Function} scm_t_int16 scm_to_int16 (SCM x)
@@ -447,6 +448,7 @@ the corresponding types are.
 @deftypefnx {C Function} SCM scm_from_ulong_long (unsigned long long x)
 @deftypefnx {C Function} SCM scm_from_size_t (size_t x)
 @deftypefnx {C Function} SCM scm_from_ssize_t (ssize_t x)
address@hidden {C Function} SCM scm_from_ptrdiff_t (scm_t_ptrdiff x)
 @deftypefnx {C Function} SCM scm_from_int8 (scm_t_int8 x)
 @deftypefnx {C Function} SCM scm_from_uint8 (scm_t_uint8 x)
 @deftypefnx {C Function} SCM scm_from_int16 (scm_t_int16 x)
diff --git a/doc/ref/api-foreign.texi b/doc/ref/api-foreign.texi
index f8ed4cc..2473870 100644
--- a/doc/ref/api-foreign.texi
+++ b/doc/ref/api-foreign.texi
@@ -489,6 +489,8 @@ platform-dependent size:
 @defvrx {Scheme Variable} long
 @defvrx {Scheme Variable} unsigned-long
 @defvrx {Scheme Variable} size_t
address@hidden {Scheme Variable} ssize_t
address@hidden {Scheme Variable} ptrdiff_t
 Values exported by the @code{(system foreign)} module, representing C
 numeric types. For example, @code{long} may be @code{equal?} to
 @code{int64} on a 64-bit platform.
diff --git a/libguile/foreign.c b/libguile/foreign.c
index 320e20d..f5819c4 100644
--- a/libguile/foreign.c
+++ b/libguile/foreign.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010, 2011, 2012  Free Software Foundation, Inc.
+/* Copyright (C) 2010, 2011, 2012, 2013  Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -53,6 +53,8 @@ SCM_SYMBOL (sym_unsigned_short, "unsigned-short");
 SCM_SYMBOL (sym_unsigned_int, "unsigned-int");
 SCM_SYMBOL (sym_unsigned_long, "unsigned-long");
 SCM_SYMBOL (sym_size_t, "size_t");
+SCM_SYMBOL (sym_ssize_t, "ssize_t");
+SCM_SYMBOL (sym_ptrdiff_t, "ptrdiff_t");
 
 /* that's for pointers, you know. */
 SCM_SYMBOL (sym_asterisk, "*");
@@ -1284,6 +1286,26 @@ scm_init_foreign (void)
 #endif
              );
 
+  scm_define (sym_ssize_t,
+#if SIZEOF_SIZE_T == 8
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT64)
+#elif SIZEOF_SIZE_T == 4
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT32)
+#else
+# error unsupported sizeof (ssize_t)
+#endif
+             );
+
+  scm_define (sym_ptrdiff_t,
+#if SCM_SIZEOF_SCM_T_PTRDIFF == 8
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT64)
+#elif SCM_SIZEOF_SCM_T_PTRDIFF == 4
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT32)
+#else
+# error unsupported sizeof (scm_t_ptrdiff)
+#endif
+             );
+
   null_pointer = scm_cell (scm_tc7_pointer, 0);
   scm_define (sym_null, null_pointer);
 }
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index 77ab94f..a26a7f4 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -268,7 +268,7 @@ main (int argc, char *argv[])
   pf ("typedef %s scm_t_uint64;\n", SCM_I_GSC_T_UINT64);
 
   pf ("\n");
-  pf ("/* scm_t_ptrdiff_t and size, always defined -- defined to long if\n"
+  pf ("/* scm_t_ptrdiff and size, always defined -- defined to long if\n"
       "   platform doesn't have ptrdiff_t. */\n");
   pf ("typedef %s scm_t_ptrdiff;\n", SCM_I_GSC_T_PTRDIFF);
   if (0 == strcmp ("long", SCM_I_GSC_T_PTRDIFF))
diff --git a/libguile/numbers.h b/libguile/numbers.h
index 68f321e..2c8b260 100644
--- a/libguile/numbers.h
+++ b/libguile/numbers.h
@@ -3,7 +3,8 @@
 #ifndef SCM_NUMBERS_H
 #define SCM_NUMBERS_H
 
-/* Copyright (C) 1995,1996,1998,2000,2001,2002,2003,2004,2005, 2006, 2008, 
2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,2000,2001,2002,2003,2004,2005, 2006,
+ *   2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -501,6 +502,18 @@ SCM_API SCM  scm_from_mpz (mpz_t rop);
 #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
+#else
+#if SCM_SIZEOF_SCM_T_PTRDIFF == 8
+#define scm_to_ptrdiff_t    scm_to_int64
+#define scm_from_ptrdiff_t  scm_from_int64
+#else
+#error sizeof(scm_t_ptrdiff) is not 4 or 8.
+#endif
+#endif
+
 /* conversion functions for double */
 
 SCM_API int scm_is_real (SCM val);
diff --git a/module/system/foreign.scm b/module/system/foreign.scm
index 37f9b41..e4db6ff 100644
--- a/module/system/foreign.scm
+++ b/module/system/foreign.scm
@@ -1,4 +1,4 @@
-;;;;   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2010, 2011, 2013 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -25,7 +25,7 @@
             float double
             short
             unsigned-short
-            int unsigned-int long unsigned-long size_t
+            int unsigned-int long unsigned-long size_t ssize_t ptrdiff_t
             int8 uint8
             uint16 int16
             uint32 int32


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]