diff options
Diffstat (limited to 'src/mpfr-impl.h')
-rw-r--r-- | src/mpfr-impl.h | 79 |
1 files changed, 17 insertions, 62 deletions
diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h index 1361759eb..97cd869b3 100644 --- a/src/mpfr-impl.h +++ b/src/mpfr-impl.h @@ -205,73 +205,28 @@ struct __gmpfr_cache_s { typedef struct __gmpfr_cache_s mpfr_cache_t[1]; typedef struct __gmpfr_cache_s *mpfr_cache_ptr; -#if defined(MPFR_USE_THREAD_SAFE) && defined(__GMP_LIBGMP_DLL) -# define MPFR_WIN_THREAD_SAFE_DLL 1 -#endif +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_flags_t __gmpfr_flags; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_exp_t __gmpfr_emin; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_exp_t __gmpfr_emax; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_prec_t __gmpfr_default_fp_bit_precision; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_rnd_t __gmpfr_default_rounding_mode; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_euler; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_catalan; -#if defined(__MPFR_WITHIN_MPFR) || !defined(MPFR_WIN_THREAD_SAFE_DLL) -extern MPFR_THREAD_ATTR mpfr_flags_t __gmpfr_flags; -extern MPFR_THREAD_ATTR mpfr_exp_t __gmpfr_emin; -extern MPFR_THREAD_ATTR mpfr_exp_t __gmpfr_emax; -extern MPFR_THREAD_ATTR mpfr_prec_t __gmpfr_default_fp_bit_precision; -extern MPFR_THREAD_ATTR mpfr_rnd_t __gmpfr_default_rounding_mode; -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_euler; -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_catalan; -# ifndef MPFR_USE_LOGGING -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_pi; -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_log2; -# else +#ifndef MPFR_USE_LOGGING +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_pi; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_cache_const_log2; +#else /* Two constants are used by the logging functions (via mpfr_fprintf, then mpfr_log, for the base conversion): pi and log(2). Since the mpfr_cache function isn't re-entrant when working on the same cache, we need to define two caches for each constant. */ -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_normal_pi; -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_normal_log2; -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_logging_pi; -extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_logging_log2; -extern MPFR_THREAD_ATTR mpfr_cache_ptr __gmpfr_cache_const_pi; -extern MPFR_THREAD_ATTR mpfr_cache_ptr __gmpfr_cache_const_log2; -# endif -#endif - -#ifdef MPFR_WIN_THREAD_SAFE_DLL -__MPFR_DECLSPEC mpfr_flags_t * __gmpfr_flags_f(); -__MPFR_DECLSPEC mpfr_exp_t * __gmpfr_emin_f(); -__MPFR_DECLSPEC mpfr_exp_t * __gmpfr_emax_f(); -__MPFR_DECLSPEC mpfr_prec_t * __gmpfr_default_fp_bit_precision_f(); -__MPFR_DECLSPEC mpfr_rnd_t * __gmpfr_default_rounding_mode_f(); -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_cache_const_euler_f(); -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_cache_const_catalan_f(); -# ifndef MPFR_USE_LOGGING -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_cache_const_pi_f(); -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_cache_const_log2_f(); -# else -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_normal_pi_f(); -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_normal_log2_f(); -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_logging_pi_f(); -__MPFR_DECLSPEC mpfr_cache_t * __gmpfr_logging_log2_f(); -__MPFR_DECLSPEC mpfr_cache_ptr * __gmpfr_cache_const_pi_f(); -__MPFR_DECLSPEC mpfr_cache_ptr * __gmpfr_cache_const_log2_f(); -# endif -# ifndef __MPFR_WITHIN_MPFR -# define __gmpfr_flags (*__gmpfr_flags_f()) -# define __gmpfr_emin (*__gmpfr_emin_f()) -# define __gmpfr_emax (*__gmpfr_emax_f()) -# define __gmpfr_default_fp_bit_precision (*__gmpfr_default_fp_bit_precision_f()) -# define __gmpfr_default_rounding_mode (*__gmpfr_default_rounding_mode_f()) -# define __gmpfr_cache_const_euler (*__gmpfr_cache_const_euler_f()) -# define __gmpfr_cache_const_catalan (*__gmpfr_cache_const_catalan_f()) -# ifndef MPFR_USE_LOGGING -# define __gmpfr_cache_const_pi (*__gmpfr_cache_const_pi_f()) -# define __gmpfr_cache_const_log2 (*__gmpfr_cache_const_log2_f()) -# else -# define __gmpfr_normal_pi (*__gmpfr_normal_pi_f()) -# define __gmpfr_logging_pi (*__gmpfr_logging_pi_f()) -# define __gmpfr_logging_log2 (*__gmpfr_logging_log2_f()) -# define __gmpfr_cache_const_pi (*__gmpfr_cache_const_pi_f()) -# define __gmpfr_cache_const_log2 (*__gmpfr_cache_const_log2_f()) -# endif -# endif +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_normal_pi; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_normal_log2; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_logging_pi; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_t __gmpfr_logging_log2; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_ptr __gmpfr_cache_const_pi; +__MPFR_DECLSPEC extern MPFR_THREAD_ATTR mpfr_cache_ptr __gmpfr_cache_const_log2; #endif #define BASE_MAX 62 |