[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 10/86: Assume that if we have GCC, we have GCC >= 3.0.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 10/86: Assume that if we have GCC, we have GCC >= 3.0. |
Date: |
Wed, 20 Jun 2018 14:09:28 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 63e5eafd83bf281e9bf64973b8725fe75954374c
Author: Andy Wingo <address@hidden>
Date: Sun Jun 17 20:34:05 2018 +0200
Assume that if we have GCC, we have GCC >= 3.0.
* libguile/__scm.h (SCM_GNUC_PREREQ): Remove this definition. Assume
that if we have GCC, that we have GCC >= 3.0 (from 2002). Adapt uses
to use simply "#ifdef __GNUC__".
* libguile/deprecated.h (SCM_GNUC_PREREQ): Add deprecated definition.
---
libguile/__scm.h | 15 +++------------
libguile/deprecated.h | 9 +++++++++
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/libguile/__scm.h b/libguile/__scm.h
index 518a3f4..705642e 100644
--- a/libguile/__scm.h
+++ b/libguile/__scm.h
@@ -63,15 +63,6 @@
* additional information to the developers.
*/
-/* Return true (non-zero) if GCC version MAJ.MIN or later is being used
- * (macro taken from glibc.) */
-#if defined __GNUC__ && defined __GNUC_MINOR__
-# define SCM_GNUC_PREREQ(maj, min) \
- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define SCM_GNUC_PREREQ(maj, min) 0
-#endif
-
/* The macro SCM_NORETURN indicates that a function will never return.
* Examples:
* 1) int foo (char arg) SCM_NORETURN;
@@ -99,7 +90,7 @@
/* The SCM_EXPECT macros provide branch prediction hints to the compiler. To
* use only in places where the result of the expression under "normal"
* circumstances is known. */
-#if SCM_GNUC_PREREQ (3, 0)
+#ifdef __GNUC__
# define SCM_EXPECT __builtin_expect
#else
# define SCM_EXPECT(_expr, _value) (_expr)
@@ -118,7 +109,7 @@
* or variables. Defining `SCM_BUILDING_DEPRECATED_CODE' allows deprecated
* functions to be implemented in terms of deprecated functions, and allows
* deprecated functions to be referred to by `scm_c_define_gsubr ()'. */
-#if !defined (SCM_BUILDING_DEPRECATED_CODE) && SCM_GNUC_PREREQ (3, 0)
+#if !defined (SCM_BUILDING_DEPRECATED_CODE) && defined __GNUC__
# define SCM_DEPRECATED SCM_API __attribute__ ((__deprecated__))
#else
# define SCM_DEPRECATED SCM_API
@@ -139,7 +130,7 @@
/* The SCM_MALLOC macro can be used in function declarations to tell the
* compiler that a function may be treated as if any non-NULL pointer it
returns
* cannot alias any other pointer valid when the function returns. */
-#if SCM_GNUC_PREREQ (3, 0)
+#ifdef __GNUC__
# define SCM_MALLOC __attribute__ ((__malloc__))
#else
# define SCM_MALLOC
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index 88b86df..d183619 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -25,6 +25,15 @@
/* Deprecated declarations go here. */
+/* Return true (non-zero) if GCC version MAJ.MIN or later is being used
+ * (macro taken from glibc.) */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define SCM_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define SCM_GNUC_PREREQ(maj, min) 0
+#endif
+
#define scm_i_jmp_buf scm_i_jmp_buf_GONE__USE_JMP_BUF_INSTEAD
void scm_i_init_deprecated (void);
- [Guile-commits] 06/86: Remove _scm.h inclusion of config.h, (continued)
- [Guile-commits] 06/86: Remove _scm.h inclusion of config.h, Andy Wingo, 2018/06/20
- [Guile-commits] 09/86: Remove alignof.h inclusion from _scm.h, Andy Wingo, 2018/06/20
- [Guile-commits] 03/86: Remove _scm hack to undefine HAVE_STRUCT_TIMESPEC, Andy Wingo, 2018/06/20
- [Guile-commits] 04/86: Refactor regarding internal detection of ia64, Andy Wingo, 2018/06/20
- [Guile-commits] 08/86: Remove _scm.h verify.h inclusion, Andy Wingo, 2018/06/20
- [Guile-commits] 07/86: Remove errno.h include from _scm.h., Andy Wingo, 2018/06/20
- [Guile-commits] 11/86: Require C99 to build Guile, Andy Wingo, 2018/06/20
- [Guile-commits] 01/86: Move syscall-related private defines to their own header, Andy Wingo, 2018/06/20
- [Guile-commits] 19/86: Remove public SCM_VALIDATE_NIM, Andy Wingo, 2018/06/20
- [Guile-commits] 17/86: Remove unused macros, Andy Wingo, 2018/06/20
- [Guile-commits] 10/86: Assume that if we have GCC, we have GCC >= 3.0.,
Andy Wingo <=
- [Guile-commits] 05/86: Inline definition of SIZEOF_SCM_T_BITS, Andy Wingo, 2018/06/20
- [Guile-commits] 13/86: Remove _scm.h print.h include, Andy Wingo, 2018/06/20
- [Guile-commits] 15/86: Move number validators to numbers.h., Andy Wingo, 2018/06/20
- [Guile-commits] 16/86: Move more number validators to numbers.h., Andy Wingo, 2018/06/20
- [Guile-commits] 24/86: Deprecate libguile/validate.h, Andy Wingo, 2018/06/20
- [Guile-commits] 14/86: Move core validate macros to error.h, Andy Wingo, 2018/06/20
- [Guile-commits] 18/86: Move list validators to list.h, Andy Wingo, 2018/06/20
- [Guile-commits] 31/86: Remove gc.h from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 32/86: Remove threads.h from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 12/86: Remove error.h include from _scm.h., Andy Wingo, 2018/06/20