mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
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.
This commit is contained in:
parent
e48567fa6c
commit
63e5eafd83
2 changed files with 12 additions and 12 deletions
|
@ -63,15 +63,6 @@
|
||||||
* additional information to the developers.
|
* 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.
|
/* The macro SCM_NORETURN indicates that a function will never return.
|
||||||
* Examples:
|
* Examples:
|
||||||
* 1) int foo (char arg) SCM_NORETURN;
|
* 1) int foo (char arg) SCM_NORETURN;
|
||||||
|
@ -99,7 +90,7 @@
|
||||||
/* The SCM_EXPECT macros provide branch prediction hints to the compiler. To
|
/* The SCM_EXPECT macros provide branch prediction hints to the compiler. To
|
||||||
* use only in places where the result of the expression under "normal"
|
* use only in places where the result of the expression under "normal"
|
||||||
* circumstances is known. */
|
* circumstances is known. */
|
||||||
#if SCM_GNUC_PREREQ (3, 0)
|
#ifdef __GNUC__
|
||||||
# define SCM_EXPECT __builtin_expect
|
# define SCM_EXPECT __builtin_expect
|
||||||
#else
|
#else
|
||||||
# define SCM_EXPECT(_expr, _value) (_expr)
|
# define SCM_EXPECT(_expr, _value) (_expr)
|
||||||
|
@ -118,7 +109,7 @@
|
||||||
* or variables. Defining `SCM_BUILDING_DEPRECATED_CODE' allows deprecated
|
* or variables. Defining `SCM_BUILDING_DEPRECATED_CODE' allows deprecated
|
||||||
* functions to be implemented in terms of deprecated functions, and allows
|
* functions to be implemented in terms of deprecated functions, and allows
|
||||||
* deprecated functions to be referred to by `scm_c_define_gsubr ()'. */
|
* 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__))
|
# define SCM_DEPRECATED SCM_API __attribute__ ((__deprecated__))
|
||||||
#else
|
#else
|
||||||
# define SCM_DEPRECATED SCM_API
|
# define SCM_DEPRECATED SCM_API
|
||||||
|
@ -139,7 +130,7 @@
|
||||||
/* The SCM_MALLOC macro can be used in function declarations to tell the
|
/* 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
|
* 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. */
|
* cannot alias any other pointer valid when the function returns. */
|
||||||
#if SCM_GNUC_PREREQ (3, 0)
|
#ifdef __GNUC__
|
||||||
# define SCM_MALLOC __attribute__ ((__malloc__))
|
# define SCM_MALLOC __attribute__ ((__malloc__))
|
||||||
#else
|
#else
|
||||||
# define SCM_MALLOC
|
# define SCM_MALLOC
|
||||||
|
|
|
@ -25,6 +25,15 @@
|
||||||
|
|
||||||
/* Deprecated declarations go here. */
|
/* 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
|
#define scm_i_jmp_buf scm_i_jmp_buf_GONE__USE_JMP_BUF_INSTEAD
|
||||||
|
|
||||||
void scm_i_init_deprecated (void);
|
void scm_i_init_deprecated (void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue