[AMD64] and other 64-bit platforms

I’m guessing we are going to have to be careful as we get more 64 bit
builds/machines. (Not made easy by differences in C compilers for
different platforms, of course.)

from gcc manual … for AMD x86-64
-m32
-m64
Generate code for a 32-bit or 64-bit environment. The 32-bit
environment sets int, long and pointer to 32 bits and generates code
that runs on any i386 system. The 64-bit environment sets int to 32
bits and long and pointer to 64 bits and generates code for AMD’s
x86-64 architecture.

from gcc manual … for PowerPC
-m32
-m64
Generate code for 32-bit or 64-bit environments of Darwin and SVR4
targets (including GNU/Linux). The 32-bit environment sets int, long
and pointer to 32 bits and generates code that runs on any PowerPC
variant. The 64-bit environment sets int to 32 bits and long and
pointer to 64 bits, and generates code for PowerPC64, as for
-mpowerpc64

At least gcc is compatible with itself across these two processors
for longs and ints!

Apple has a table with interesting size information related to int,
long, long long and pointers here (three quarters down the page).

http://developer.apple.com/macosx/64bit.html

Not sure which “Windows” they are specifically talking about - and no
idea what Visual Studio does (does it even support 64-bit yet?)

Regards,
Rob>On Thursday 30 December 2004 21:20, Thomas Harning Jr. wrote:

On my Gentoo AMD64 system [compiled 64-bit] I am having difficulties
w/ Gamepad & Joystick inputs.

On Mon, 16 May 2005, Tyler Montbriand wrote:

I believe I have located the issue.

/* from /usr/include/linux/joystick.h… */

struct JS_DATA_SAVE_TYPE {
int JS_TIMEOUT;
int BUSY;
long JS_EXPIRETIME;
long JS_TIMELIMIT;
struct JS_DATA_TYPE JS_SAVE;
struct JS_DATA_TYPE JS_CORR;
};

See those longs? They’re 64-bit under 64-bit and 32-bit under 32-bit. Ergo
the 32-bit and 64-bit versions aren’t using the same structure. Now, I don’t
know how to solve this, maybye those two do need to be long’s. Or maybye
they don’t.

Rob,

Indeed, the new 64-bit Windows versions use the LLP64 model (ints and
longs are 32 bit, pointers are 64 bit).

AFAIK, these Windows versions would be the new x64 Editions of XP
Professional and Server 2003, which have been recently released. These
should support AMD64; I don’t know if the Itanium versions are out yet.

64-bit compilers for the Windows platform have been available in the
Platform SDK for a while now. The new Visual Studio will include them.

Regards,

Vasco Veloso

sdl-request at libsdl.org wrote:>----------------------------------------------------------------------

Message: 1
Date: Fri, 20 May 2005 21:38:22 +0100
From: Rob Probin
Subject: [SDL] Re: [AMD64] and other 64-bit platforms
To: sdl at libsdl.org
Message-ID: <p06200709beb3f8a9aa23@[10.0.1.100]>
Content-Type: text/plain; charset=“us-ascii” ; format=“flowed”

(…)

Apple has a table with interesting size information related to int,
long, long long and pointers here (three quarters down the page).

http://developer.apple.com/macosx/64bit.html

Not sure which “Windows” they are specifically talking about - and no
idea what Visual Studio does (does it even support 64-bit yet?)

Regards,
Rob

Indeed, the new 64-bit Windows versions use the LLP64 model (ints and
longs are 32 bit, pointers are 64 bit).

And you have to use the __int64 type (or perhaps “long long”) to get a
64-bit int.

Has anyone built SDL on Win64 yet to see if it works?

–ryan.