delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/29/16:15:38

From: Mark van der Aalst <flux AT stack DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: faking 64bit integer
Date: 29 Jul 1998 01:33:09 +0200
Organization: Eindhoven University of Technology, The Netherlands
Lines: 22
Sender: flux AT toad DOT stack DOT nl
Message-ID: <6pln3l$im8$1@toad.stack.nl>
NNTP-Posting-Host: toad.stack.nl
User-Agent: tin/pre-1.4-980202 (UNIX) (FreeBSD/2.2.6-STABLE (i386))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

G'day, I've been wondering if somebody could provide me with some hints
to the following problem ; I've got a large library wich is supposed to
be 99.9% ANSI compliant C code. Now I'm able to compile it on any 32bit
compiler I've come across without any problems but I now want to find out
if it will still work on 64bit platforms (wich it should). Since I've got no
access to 64 bit hardware I was wondering why I couldn't just fake one by
changing a couple of defines (mainly <limits.h>) and change types like int
(and related, size_t etc) to 64bit (e.g. long long) - now my question i
what would be the easiest way to do this, I could hack the compiler sources
to generate code for 64bit ints (e.g. basically write 'long long' whenever
it encounters 'int' or 'long') another way, but less attrictive, would be
to change all my ints, longs, size_t's etc to some macro wich would expand
to the appropriate type (long long) - this would work but would take lots
of work ... anybody got an idea how I could tackle this problem in a
fairly easy way ? So the question really is, how do I tell the compiler
it's not a 32bit compiler but a 64bit compiler ?

Any hints or help would be greatly appreciated,

Cheers, flux.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019