/* Definitions for GNU multiple precision functions. -*- mode: c -*-
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#ifndef __GMP_H__
#if defined (__cplusplus)
#include <iosfwd> /* for std::istream, std::ostream, std::string */
#include <cstdio>
#endif
/* Instantiated by configure. */
#if ! defined (__GMP_WITHIN_CONFIGURE)
#define __GMP_HAVE_HOST_CPU_FAMILY_power 0
#define __GMP_HAVE_HOST_CPU_FAMILY_powerpc 0
#define GMP_LIMB_BITS 64
#define GMP_NAIL_BITS 0
#endif
#define GMP_NUMB_BITS (GMP_LIMB_BITS - GMP_NAIL_BITS)
#define GMP_NUMB_MASK ((~ __GMP_CAST (mp_limb_t, 0)) >> GMP_NAIL_BITS)
#define GMP_NUMB_MAX GMP_NUMB_MASK
#define GMP_NAIL_MASK (~ GMP_NUMB_MASK)
/* The following (everything under ifndef __GNU_MP__) must be identical in
gmp.h and mp.h to allow both to be included in an application or during
the library build. */
#ifndef __GNU_MP__
#define __GNU_MP__ 5
#define __need_size_t /* tell gcc stddef.h we only want size_t */
#if defined (__cplusplus)
#include <cstddef> /* for size_t */
#else
#include <stddef.h> /* for size_t */
#endif
#undef __need_size_t
/* Instantiated by configure. */
#if ! defined (__GMP_WITHIN_CONFIGURE)
#define _LONG_LONG_LIMB 1
#define __GMP_LIBGMP_DLL 1
#endif
/* __STDC__ - some ANSI compilers define this only to 0, hence the use of
"defined" and not "__STDC__-0". In particular Sun workshop C 5.0
sets __STDC__ to 0, but requires "##" for token pasting.
_AIX - gnu ansidecl.h asserts that all known AIX compilers are ANSI but
don't always define __STDC__.
__DECC - current versions of DEC C (5.9 for instance) for alpha are ANSI,
but don't define __STDC__ in their default mode. Don't know if old
versions might have been K&R, but let's not worry about that unless
someone is still using one.
_mips - gnu ansidecl.h says the RISC/OS MIPS compiler is ANSI in SVR4
mode, but doesn't define __STDC__.
_MSC_VER - Microsoft C is ANSI, but __STDC__ is undefined unless the /Za
option is given (in which case it's 1).
_WIN32 - tested for by gnu ansidecl.h, no doubt on the assumption that
all w32 compilers are ansi.
Note: This same set of tests is used by gen-psqr.c and
demos/expr/expr-impl.h, so if anything needs adding, then be sure to
update those too. */
#if defined (__STDC__) \
|| defined (__cplusplus) \
|| defined (_AIX) \
|| defined (__DECC) \
|| (defined (__mips) && defined (_SYSTYPE_SVR4)) \
|| defined (_MSC_VER) \
|| defined (_WIN32)
#define __GMP_HAVE_CONST 1
#define __GMP_HAVE_PROTOTYPES 1
#define __GMP_HAVE_TOKEN_PASTE 1
#else
#define __GMP_HAVE_CONST 0
#define __GMP_HAVE_PROTOTYPES 0
#define __GMP_HAVE_TOKEN_PASTE 0
#endif
#if __GMP_HAVE_CONST
#define __gmp_const const
#define __gmp_signed signed
#else
#define __gmp_const
#define __gmp_signed
#endif
/* __GMP_DECLSPEC supports Windows DLL versions of libgmp, and is empty in
all other circumstances.
When compiling objects for libgmp, __GMP_DECLSPEC is an export directive,
or when compiling for an application it's an import directive. The two
cases are differentiated by __GMP_WITHIN_GMP defined by the GMP Makefiles
(and not defined from an application).
__GMP_DECLSPEC_XX is similarly used for libgmpxx. __GMP_WITHIN_GMPXX
indicates when building libgmpxx, and in that case libgmpxx functions are
exports, but libgmp functions which might get called are imports.
libmp.la uses __GMP_DECLSPEC, just as if it were libgmp.la. libgmp and
libmp don't call each other, so there's no conflict or confusion.
Libtool DLL_EXPORT define is not used.
There's no attempt to support GMP built both static and DLL. Doing so
would mean applications would have to tell us which of the two is going
to be used when linking, and that seems very tedious and error prone if
using GMP by hand, and equally tedious from a package since autoconf and
automake don't give much help.
__GMP_DECLSPEC is required on all documented global functions and
variables, the various internals in gmp-impl.h etc can be left unadorned.
But internals used by the test programs or speed measuring programs
should have __GMP_DECLSPEC, and certainly constants or variables must
have it or the wrong address will be resolved.
In gcc __declspec can go at either the start or end of a prototype.
In Microsoft C __declspec must go at the start, or after the type like
void __declspec(...) *foo()". There's no __dllexport or anything to
guard against someone foolish #defining dllexport. _export used to be
available, but no longer.
In Borland C _export still exists, but needs to go after the type, like
"void _export foo();". Would have to change the __GMP_DECLSPEC syntax to
make use of that. Probably more trouble than it's worth. */
#if defined (__GNUC__)
#define __GMP_DECLSPEC_EXPORT __declspec(__dllexport__)
#define __GMP_DECLSPEC_IMPORT __declspec(__dllimport__)
#endif
#if defined (_MSC_VER) || defined (__BORLANDC__)
#define __GMP_DECLSPEC_EXPORT __declspec(dllexport)
#define __GMP_DECLSPEC_IMPORT __declspec(dllimport)
#endif
#ifdef __WATCOMC__
#define __GMP_DECLSPEC_EXPORT __export
#define __GMP_DECLSPEC_IMPORT __import
#endif
#ifdef __IBMC__
#define __GMP_DECLSPEC_EXPORT _Export
#define __GMP_DECLSPEC_IMPORT _Import
#endif
#if __GMP_LIBGMP_DLL
#if __GMP_WITHIN_GMP
/* compiling to go into a DLL libgmp */
#define __GMP_DECLSPEC __GMP_DECLSPEC_EXPORT
#else
/* compiling to go into an application which will link to a DLL libgmp */
#define __GMP_DECLSPEC __GMP_DECLSPEC_IMPORT
#endif
#else
/* all other cases */
#define __GMP_DECLSPEC
#endif
#ifdef __GMP_SHORT_LIMB
typedef unsigned int mp_limb_t;
typedef int mp_limb_signed_t;
#else
#ifdef _LONG_LONG_LIMB
typedef unsigned long long int mp_limb_t;
typedef long long int mp_limb_signed_t;
#else
typedef unsigned long int mp_limb_t;
typedef long int mp_limb_signed_t;
#endif
#endif
typedef unsigned long int mp_bitcnt_t;
/* For reference, note that the name __mpz_struct gets into C++ mangled
function names, which means although the "__" suggests an internal, we
must leave this name for binary compatibility. */
typedef struct
{
int _mp_alloc; /* Number of *limbs* allocated and pointed
to by the _mp_d field. */
int _mp_size; /* abs(_mp_size) is the number of limbs the
last field points to. If _mp_size is
negative this is a negative number. */
mp_limb_t *_mp_d; /* Pointer to the limbs. */
} __mpz_struct;
#endif /* __GNU_MP__ */
typedef __mpz_struct MP_INT; /* gmp 1 source compatibility */
typedef __mpz_struct mpz_t[1];
typedef mp_limb_t * mp_ptr;
typedef __gmp_const mp_limb_t * mp_srcptr;
#if defined (_CRAY) && ! defined (_CRAYMPP)
/* plain `int' is much faster (48 bits) */
#define __GMP_MP_SIZE_T_INT 1
typedef int mp_size_t;
typedef int mp_exp_t;
#else
#define __GMP_MP_SIZ
没有合适的资源?快使用搜索试试~ 我知道了~
gmp lib x64
共14个文件
readme:3个
lib:3个
h:3个
5星 · 超过95%的资源 需积分: 15 53 下载量 106 浏览量
2015-08-05
21:21:26
上传
评论
收藏 445KB RAR 举报
温馨提示
c语言写成的一个便携式库,它可以进行整数、有理数和浮点数的任 意精度算术,其目标是为所有需要不能由基本
资源推荐
资源详情
资源评论
收起资源包目录
gmp.rar (14个子文件)
gmp
gmp.COPYING 34KB
mpfr.README 4KB
gmp.README 4KB
include
mpfr.h 45KB
mpf2mpfr.h 6KB
gmp.h 84KB
mpfr.COPYING.LESSER 7KB
gmp.COPYING.LIB 7KB
README 128B
mpfr.COPYING 34KB
lib
libgmp-10.dll 530KB
libgmp-10.lib 107KB
libmpfr-4.lib 67KB
libmpfr-4.dll 426KB
共 14 条
- 1
资源评论
- yeshibei2019-04-03很好,一下子解决了我的问题!!!感谢!!!
- y0m0d02018-05-30学习GMP库静态文件
- 傷狠羙2018-10-02能用是x64的,但不是静态库啊 需要打包gmp.dll文件
- apiaolaiye2015-08-06好东西,对我挺有帮助的。。谢谢!!!
fhjziying123
- 粉丝: 1
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功