summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-11-29 15:35:52 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-11-29 15:35:52 +0000
commit290923bb083c928544300c7a30c402baa7e208f9 (patch)
tree17d40b62d021f2ba69994da5030c7738fa8cec60 /src
parent35e3849434884dc79d63996efba6576345714bea (diff)
downloadmpfr-290923bb083c928544300c7a30c402baa7e208f9.tar.gz
[src/mpfr.h] Defined MPFR_DEPRECATED to mark MPFR functions, types
or variables as deprecated. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7273 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src')
-rw-r--r--src/mpfr.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mpfr.h b/src/mpfr.h
index 139c0d5c6..67fb3dd57 100644
--- a/src/mpfr.h
+++ b/src/mpfr.h
@@ -231,6 +231,17 @@ typedef enum {
# define __MPFR_DECLSPEC __GMP_DECLSPEC
#endif
+/* Use MPFR_DEPRECATED to mark MPFR functions, types or variables as
+ deprecated. Code inspired by Apache Subversion's svn_types.h file. */
+#if defined(__GNUC__) && \
+ (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+# define MPFR_DEPRECATED __attribute__ ((deprecated))
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
+# define MPFR_DEPRECATED __declspec(deprecated)
+#else
+# define MPFR_DEPRECATED
+#endif
+
/* Note: In order to be declared, some functions need a specific
system header to be included *before* "mpfr.h". If the user
forgets to include the header, the MPFR function prototype in
@@ -923,6 +934,13 @@ __MPFR_DECLSPEC int mpfr_custom_get_kind _MPFR_PROTO ((mpfr_srcptr));
( mpfr_init(x), mpfr_set_f((x), (y), (rnd)) )
/* Compatibility layer -- obsolete functions and macros */
+/* Note: it is not possible to output warnings, unless one defines
+ a deprecated variable and uses it, e.g.
+ MPFR_DEPRECATED extern int mpfr_deprecated_feature;
+ #define MPFR_EMIN_MIN ((void)mpfr_deprecated_feature,mpfr_get_emin_min())
+ (the cast to void avoids a warning because the left-hand operand
+ has no effect).
+ */
#define mpfr_cmp_abs mpfr_cmpabs
#define mpfr_round_prec(x,r,p) mpfr_prec_round(x,p,r)
#define __gmp_default_rounding_mode (mpfr_get_default_rounding_mode())