понадобилось старый проект скомпилить под новую систему.
в файле rsa.h==============
#include <stdio.h>
/* ************************************************** */
/* Please modify this value to suit your application */
#define MAXBITS 128
/* Remove the following line to use a pure C version*/
// #define ANSIC
/* ************************************************** */
//typedef xdata unsigned char DIGIT_T ;
//typedef xdata unsigned long bdigit_t;
//typedef xdata unsigned int size_t_;
typedef unsigned char DIGIT_T ;
typedef unsigned long bdigit_t;
typedef unsigned int size_t_;
/*
"Contains BIGDIGITS multiple-precision arithmetic code originally
written by David Ireland, copyright (c) 2001-6 by D.I. Management
Services Pty Limited <www.di-mgt.com.au>, and is used with
permission."
*/
/* Useful macros */
#define MAXDIGITS MAXBITS/8
#define ISODD(x) ((x) & 0x1)
#define ISEVEN(x) (!ISODD(x))
#define mpISODD(x, n) (x[0] & 0x1)
#define mpISEVEN(x, n) (!(x[0] & 0x1))
#define mpNEXTBITMASK(mask, n) do{if(mask==1){mask=HIBITMASK;n--;}else{mask>>=1;}}while(0)
/* Sizes to match */
#define MAX_DIGIT 0xff
#define MAX_HALF_DIGIT 0x0f /* NB 'L' */
#define BITS_PER_DIGIT 8
#define BITS_PER_HALF_DIGIT 4
#define HIBITMASK 0x80
#define LOHALF(x) ((DIGIT_T)((x) & MAX_HALF_DIGIT))
#define HIHALF(x) ((DIGIT_T)((x) >> BITS_PER_HALF_DIGIT & MAX_HALF_DIGIT))
#define TOHIGH(x) ((DIGIT_T)((x) << BITS_PER_HALF_DIGIT))
void mpSetZero(DIGIT_T a[], size_t ndigits);
void mpSetEqual(DIGIT_T a[], const DIGIT_T b[], size_t ndigits);
int spMultiply(DIGIT_T p[2], DIGIT_T x, DIGIT_T y);
DIGIT_T spDivide(DIGIT_T *q, DIGIT_T *r, const DIGIT_T u[2], DIGIT_T v);
int mpModExp(DIGIT_T yout[], const DIGIT_T x[],
const DIGIT_T e[], const DIGIT_T m[], size_t ndigits);
char *copyright_notice(void);
/****************************/
/* RANDOM NUMBER OPERATIONS */
/****************************/
/* Useful definitions */
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
typedef struct T
{
DIGIT_T *digits; /* Ptr to array of digits, least sig. first */
size_t ndigits; /* No of non-zero significant digits */
size_t maxdigits; /* Max size allocated */
}RTR;
#define BIGD RTR
/* [Version 2.1: bdRandDigit and bdRandomBits moved to bigdRand.h] */
/* TYPEDEF for user-defined random byte generator function */
typedef int (* BD_RANDFUNC)(unsigned char *buf, size_t nbytes, const unsigned char *seed, size_t seedlen);
// static int (unsigned char *bytes, size_t nbytes, const unsigned char *seed, size_t seedlen);
bdigit_t bdShortMod(RTR *r, RTR *u, bdigit_t d);
DIGIT_T mpShiftRight(DIGIT_T a[], const DIGIT_T b[], size_t shift, size_t ndigits);
int spMultiply(DIGIT_T p[2], DIGIT_T x, DIGIT_T y);
DIGIT_T spDivide(DIGIT_T *q, DIGIT_T *r, const DIGIT_T u[2], DIGIT_T v);
void mpSetEqual(DIGIT_T a[], const DIGIT_T b[], size_t ndigits);
void mpSetZero(DIGIT_T a[], size_t ndigits);
int mpCompare(const DIGIT_T a[], const DIGIT_T b[], size_t ndigits);
void mpSetDigit(DIGIT_T a[], DIGIT_T d, size_t ndigits);
size_t mpSizeof(const DIGIT_T a[], size_t ndigits);
int mpSquare(DIGIT_T w[], const DIGIT_T x[], size_t ndigits);
DIGIT_T mpShiftLeft(DIGIT_T a[], const DIGIT_T *b,size_t shift, size_t ndigits);
DIGIT_T mpShiftRight(DIGIT_T a[], const DIGIT_T b[], size_t shift, size_t ndigits);
DIGIT_T mpAdd(DIGIT_T w[], const DIGIT_T u[], const DIGIT_T v[],size_t ndigits);
DIGIT_T mpShortDiv(DIGIT_T q[], const DIGIT_T u[], DIGIT_T v,size_t ndigits);
DIGIT_T mpMultSub(DIGIT_T wn, DIGIT_T w[], const DIGIT_T v[],DIGIT_T q, size_t n);
int QhatTooBig(DIGIT_T qhat, DIGIT_T rhat,DIGIT_T vn2, DIGIT_T ujn2);
int mpDivide(DIGIT_T q[], DIGIT_T r[], const DIGIT_T u[],size_t udigits, DIGIT_T v[], size_t vdigits);
int moduloTemp(DIGIT_T r[], const DIGIT_T u[], size_t udigits,DIGIT_T v[], size_t vdigits, DIGIT_T tqq[], DIGIT_T trr[]);
int modSquareTemp(DIGIT_T a[], const DIGIT_T x[],
DIGIT_T m[], size_t ndigits,
DIGIT_T temp[], DIGIT_T tqq[], DIGIT_T trr[]);
int mpMultiply(DIGIT_T w[], const DIGIT_T u[], const DIGIT_T v[],size_t ndigits);
int modMultTemp(DIGIT_T a[], const DIGIT_T x[], const DIGIT_T y[],
DIGIT_T m[], size_t ndigits,
DIGIT_T temp[], DIGIT_T tqq[], DIGIT_T trr[]);
extern int mpModExp(DIGIT_T yout[], const DIGIT_T x[],
const DIGIT_T e[], const DIGIT_T m[], size_t ndigits);
=================
в файле rsa.c
int mpModExp(DIGIT_T yout[], const DIGIT_T x[],
const DIGIT_T e[], const DIGIT_T m[], size_t_ ndigits)
{
}
под Fedora Core 8 все собиралось без проблем (i386), под FC16 ругается (x86_64) :
/rsa.c:8: error: conflicting types for 'mpModExp'
rsa.h:116: previous declaration of 'mpModExp' was here
и такая ругань на все функции объявленные в rsa.h и реализованные в rsa.c
я что то упустил в развитии компиляторов ? В заголовочнике определяем в .с реализовываем. что не так ?