[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/26: Deprecate scm_t_uint8 and similar typedefs
From: |
Andy Wingo |
Subject: |
[Guile-commits] 04/26: Deprecate scm_t_uint8 and similar typedefs |
Date: |
Tue, 26 Jun 2018 11:26:09 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 38e2c2c6b192c516fd85c6b712d675bfaa64d150
Author: Andy Wingo <address@hidden>
Date: Thu Jun 21 08:53:30 2018 +0200
Deprecate scm_t_uint8 and similar typedefs
* libguile/deprecated.h (SCM_DEPRECATED_TYPE): New helper define;
removed after.
(scm_t_int8, scm_t_uint8, scm_t_int16, scm_t_uint16)
(scm_t_int32, scm_t_uint32, scm_t_intmax, scm_t_uintmax)
(scm_t_intptr, scm_t_uintptr, scm_t_int64 scm_t_uint64)
(scm_t_ptrdiff): Deprecate these types. Even on Guile 2.2 people
should use the stdint types.
---
libguile/deprecated.h | 20 ++++++++++++++++++++
libguile/gen-scmconfig.c | 16 +---------------
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index 9552d0e..b1a15ba 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -89,6 +89,26 @@
#define SCM_HAVE_ARRAYS 1 /* always true now */
+#ifdef __GNUC__
+#define SCM_DEPRECATED_TYPE __attribute__((__deprecated__))
+#else
+#define SCM_DEPRECATED_TYPE /*deprecated*/
+#endif
+typedef int8_t scm_t_int8 SCM_DEPRECATED_TYPE;
+typedef uint8_t scm_t_uint8 SCM_DEPRECATED_TYPE;
+typedef int16_t scm_t_int16 SCM_DEPRECATED_TYPE;
+typedef uint16_t scm_t_uint16 SCM_DEPRECATED_TYPE;
+typedef int32_t scm_t_int32 SCM_DEPRECATED_TYPE;
+typedef uint32_t scm_t_uint32 SCM_DEPRECATED_TYPE;
+typedef intmax_t scm_t_intmax SCM_DEPRECATED_TYPE;
+typedef uintmax_t scm_t_uintmax SCM_DEPRECATED_TYPE;
+typedef intptr_t scm_t_intptr SCM_DEPRECATED_TYPE;
+typedef uintptr_t scm_t_uintptr SCM_DEPRECATED_TYPE;
+typedef int64_t scm_t_int64 SCM_DEPRECATED_TYPE;
+typedef uint64_t scm_t_uint64 SCM_DEPRECATED_TYPE;
+typedef ptrdiff_t scm_t_ptrdiff SCM_DEPRECATED_TYPE;
+#undef SCM_DEPRECATED_TYPE
+
void scm_i_init_deprecated (void);
#endif
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index 8eebe65..8d77dfa 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -255,20 +255,6 @@ main (int argc, char *argv[])
pf ("#define SCM_SIZEOF_INTPTR_T %zu\n", sizeof (intptr_t));
pf ("#define SCM_SIZEOF_UINTPTR_T %zu\n", sizeof (uintptr_t));
- pf("typedef int8_t scm_t_int8;\n");
- pf("typedef uint8_t scm_t_uint8;\n");
- pf("typedef int16_t scm_t_int16;\n");
- pf("typedef uint16_t scm_t_uint16;\n");
- pf("typedef int32_t scm_t_int32;\n");
- pf("typedef uint32_t scm_t_uint32;\n");
- pf("typedef intmax_t scm_t_intmax;\n");
- pf("typedef uintmax_t scm_t_uintmax;\n");
- pf("typedef intptr_t scm_t_intptr;\n");
- pf("typedef uintptr_t scm_t_uintptr;\n");
- pf("typedef int64_t scm_t_int64;\n");
- pf("typedef uint64_t scm_t_uint64;\n");
- pf("typedef ptrdiff_t scm_t_ptrdiff;\n");
-
pf ("\n");
pf ("/* same as POSIX \"struct timespec\" -- always defined */\n");
#ifdef HAVE_SYSTEM_STRUCT_TIMESPEC
@@ -345,7 +331,7 @@ main (int argc, char *argv[])
how the application that uses Guile is compiled. */
#if defined GUILE_USE_64_CALLS && defined HAVE_STAT64
- pf ("typedef scm_t_int64 scm_t_off;\n");
+ pf ("typedef int64_t scm_t_off;\n");
pf ("#define SCM_T_OFF_MAX INT64_MAX\n");
pf ("#define SCM_T_OFF_MIN INT64_MIN\n");
#elif SIZEOF_OFF_T == SIZEOF_INT
- [Guile-commits] branch master updated (1234bb1 -> 51e71a4), Andy Wingo, 2018/06/26
- [Guile-commits] 05/26: Add __scm.h placeholder, Andy Wingo, 2018/06/26
- [Guile-commits] 04/26: Deprecate scm_t_uint8 and similar typedefs,
Andy Wingo <=
- [Guile-commits] 09/26: Fix intrinsics copyright line and include guards, Andy Wingo, 2018/06/26
- [Guile-commits] 07/26: Eagerly initialize thread VM; remove scm_the_vm, Andy Wingo, 2018/06/26
- [Guile-commits] 06/26: Inline struct scm_vm into struct scm_i_thread, Andy Wingo, 2018/06/26
- [Guile-commits] 03/26: Use ptrdiff_t instead of scm_t_ptrdiff, Andy Wingo, 2018/06/26
- [Guile-commits] 10/26: expand_stack intrinsic takes thread, Andy Wingo, 2018/06/26
- [Guile-commits] 01/26: Start to use C99 stdint in gen-scmconfig, Andy Wingo, 2018/06/26
- [Guile-commits] 08/26: VM gets VP from thread, Andy Wingo, 2018/06/26
- [Guile-commits] 20/26: Add intrinsic for call/cc, Andy Wingo, 2018/06/26
- [Guile-commits] 18/26: Refactor continuation capture in VM, Andy Wingo, 2018/06/26
- [Guile-commits] 17/26: Foreign-call intrinsic boxes errno, Andy Wingo, 2018/06/26