Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Nikola Milutinovic <Nikola.Milutinovic@ev.co.yu>
To: "Seppo.Routimo" <Seppo.Routimo@tt.tampere.fi>
Subject: Re: PGP and DUnix
Date: 1998/12/24	[thread overview]
Message-ID: <36821C1E.B6E45C08@ev.co.yu> (raw)
In-Reply-To: 366F8B3F.5D46@tt.tampere.fi

"Seppo.Routimo" wrote:
> 
> Hi
> 
> Has anyone compiled PGP 5.0i on DUnix 4.0D?
> I seem to have problems with the source, there
> are few rows which end ;) and I think they should end );
> 
> If I change them, compile finds new errors and exits...

I'm trying as well, so if anyone has done it, let us know, please.

The problem is in "src/lib/bn/bnimem.c", more specifically in line like:

BIG(ptr = (char *)ptr - oldbytes;)

BIG is a macro:

#if !defined(BN_BIG_ENDIAN) && !defined(BN_LITTLE_ENDIAN)
#define BN_LITTLE_ENDIAN 1
#endif /* !BN_BIG_ENDIAN && !BN_LITTLE_ENDIAN */

#if BN_BIG_ENDIAN
#define BIG(b) b
#define LITTLE(l) /*nothing*/
#define BIGLITTLE(b,l) b
#elif BN_LITTLE_ENDIAN
#define BIG(b) /*nothing*/
#define LITTLE(l) l
#define BIGLITTLE(b,l) l
#else
#error One of BN_BIG_ENDIAN or BN_LITTLE_ENDIAN must be defined as 1
#endif

Basically, it should default to BN_LITTLE_ENDIAN, thus:

#define BIG(b) /*nothing*/
#define LITTLE(l) l
#define BIGLITTLE(b,l) l

The problem is in the macro, the way I see it. It doesn't get recognized
by the CPP. I've run "cc -P bnimem.c and in the resulting file I can see
that BIG is not substituted, it remains after Pre-Processor and is
treated as a function call. That is why we get a syntax error on "...
;)", If you reverse it, then you'll have linker errors, since there is
no function called "BIG".

As far as I can see, all header files are included OK, there is no
BN_*_ENDIAN definition, though. So, it should default to LITTLE and all
should go well.

The problem could be in that "no define for either *_ENDIAN". Maybe,
since BN_BIG_ENDIAN is not defined at all, the whole "#if ..."
construction fails. What is the exact CC/CPP specification on this? I'll
try making it "politically correct", by adding a line:

#if !defined(BN_BIG_ENDIAN) && !defined(BN_LITTLE_ENDIAN)
#define BN_LITTLE_ENDIAN 1
#define BN_BIG_ENDIAN 0
#endif /* !BN_BIG_ENDIAN && !BN_LITTLE_ENDIAN */

Nix.
-- 
Le ave tha t spa ce alo ne!



  reply	other threads:[~1998-12-24  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-10  5:00 PGP and DUnix Seppo.Routimo
1998-12-24  5:00 ` Nikola Milutinovic [this message]
1998-12-25  5:00   ` Thomas Leitner
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox