sfepy/sfepy — Issue #76: fix C types for 64bit architectures
Author: rc
Created: 2012-01-30 10:25:32+00:00
State: open

Having

sfepy/fem/extmods/types.h - typedef int int32;

causes that nm.int32 cannot be used where it should (have to use int).

Migrated from http://code.google.com/p/sfepy/issues/detail?id=72

earlier comments

freevryheid said, at 2010-05-18T04:03:57.000Z:

Which is the lesser of the two evils?:

typedef int int32
typedef long int32

"cannot be used where it should" - please elaborate.

robert.cimrman said, at 2010-05-18T13:08:41.000Z:

The definition as it is now causes the int32 in C to be, in fact, int64 on 64bit
machines, so it is not possible to pass nm.int32 arrays into C int32 arrays (which
are, in fact int64...). Instead, we have to use nm.int arrays, whose bit width follow
the C int bit width.

The correct way is to make sure the C int32 is really 32 bits no matter what
architecture.

As numpy guys surely know how to do this in a portable way, and we depend on numpy
headers anyway, an easy solution might be to use int32 from the numpy headers.

robert.cimrman said, at 2011-10-21T09:15:37.000Z:

Done!