Jump to content

Recommended Posts

Posted

Hello, I use a modified torque2d and got android studio work. It build fine for x86 and armeabi-v7a. But when I add x86_64 build it does not like the offset macro anymore.

I've played around with the ifdef's for gcc but no luck so far and I don't understand the problem at the moment.On :

 

addField("actionName", TypeString, Offset(mActionName, UndoAction),..

i get: error: cast from pointer to smaller type 'int' loses information


I defined the macro for x86_64/android to:

#define Offset(x, cls) ((dsize_t)(&((cls *) 1)->x) - 1)

 

because the following replacement works:

 

addField("actionName", TypeString, ((dsize_t) (&((UndoAction *) 1)->mActionName) - 1),...

 

for me the macro and the test replacement, which works, looks equal.


Edit: I also changed the dsize_t typedef in types.arm.h:

#if defined(__x86_64__) || defined(__x86_64)
typedef unsigned long long dsize_t;
#else
typedef unsigned long  dsize_t;
#endif

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...