=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/plugin/cmo-gmp.c,v retrieving revision 1.6 retrieving revision 1.10 diff -u -p -r1.6 -r1.10 --- OpenXM/src/kan96xx/plugin/cmo-gmp.c 2001/05/04 01:06:29 1.6 +++ OpenXM/src/kan96xx/plugin/cmo-gmp.c 2015/09/14 07:56:20 1.10 @@ -1,7 +1,9 @@ -/*$OpenXM: OpenXM/src/kan96xx/plugin/cmo-gmp.c,v 1.5 2000/02/01 02:38:58 noro Exp $ */ +/*$OpenXM: OpenXM/src/kan96xx/plugin/cmo-gmp.c,v 1.9 2005/07/03 11:08:54 ohara Exp $ */ #include +#include #include /* #include */ +#include #include "datatype.h" #include "stackm.h" #include "extern.h" @@ -10,12 +12,17 @@ #include "kclass.h" #include "gmp.h" -#include "gmp-impl.h" +#include "gmp-impl.h" #include "file2.h" #include "cmo.h" +/* for gmp6.0.0 */ +#ifndef BYTES_PER_MP_LIMB +#define BYTES_PER_MP_LIMB SIZEOF_MP_LIMB_T +#endif + extern int OxVersion; size_t cmoOutGMPCoeff_old(mpz_srcptr x); size_t cmoOutGMPCoeff_new(mpz_srcptr x); @@ -166,10 +173,9 @@ cmoOutGMPCoeff_new(mpz_srcptr x) tmp[0] = htonl(CMO_ZZ); cmoOutputToBuf(CMOPUT,tmp,sizeof(cmoint)); - if (BITS_PER_CHAR != 8) { - fprintf(stderr,"BITS_PER_CHAR = %d\n",BITS_PER_CHAR); + if (CHAR_BIT != 8) { + fprintf(stderr,"CHAR_BIT = %d\n",CHAR_BIT); fprintf(stderr,"cmo-gmp.c does not work on this CPU.\n"); - fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); } @@ -215,10 +221,9 @@ cmoGetGMPCoeff_new(MP_INT *x, struct cmoBuffer *cb) mp_size_t in_bytesize; int neg_flag; - if (BITS_PER_CHAR != 8) { - fprintf(stderr,"BITS_PER_CHAR = %d\n",BITS_PER_CHAR); + if (CHAR_BIT != 8) { + fprintf(stderr,"CHAR_BIT = %d\n",CHAR_BIT); fprintf(stderr,"cmo-gmp.c does not work on this CPU.\n"); - fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); } @@ -274,10 +279,9 @@ cmoOutGMPCoeff_new(mpz_srcptr x) fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); } - if (BITS_PER_CHAR != 8) { - fprintf(stderr,"BITS_PER_CHAR = %d\n",BITS_PER_CHAR); + if (CHAR_BIT != 8) { + fprintf(stderr,"CHAR_BIT = %d\n",CHAR_BIT); fprintf(stderr,"cmo-gmp.c does not work on this CPU.\n"); - fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); } @@ -320,10 +324,9 @@ cmoGetGMPCoeff_new(MP_INT *x, struct cmoBuffer *cb) fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); } - if (BITS_PER_CHAR != 8) { - fprintf(stderr,"BITS_PER_CHAR = %d\n",BITS_PER_CHAR); + if (CHAR_BIT != 8) { + fprintf(stderr,"CHAR_BIT = %d\n",CHAR_BIT); fprintf(stderr,"cmo-gmp.c does not work on this CPU.\n"); - fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); }