Dso compatibility for mac and windows
by Prairie Games · in Torque Game Engine · 04/30/2005 (7:24 pm) · 20 replies
If you have a fix for dso incompatibility between mac and windows, please post it here.
If I fix this ahead of getting one, I'll post it here.
-Josh
If I fix this ahead of getting one, I'll post it here.
-Josh
#2
Here's the fix:
They are compatible. ;)
-Josh
04/30/2005 (7:44 pm)
@Dreamer: I want to share the binaries between platforms.Here's the fix:
They are compatible. ;)
-Josh
#3
04/30/2005 (7:48 pm)
Hmm I seem to recall a thread awhile back saying they weren't, but ok well if you've gotten them to run :)
#4
I tested a number of mac dso's on a windows box and they worked...
If someone knows this is a problem, please speak up.
-Josh
04/30/2005 (7:50 pm)
Well, I should say I am not 100% on this... I tested a number of mac dso's on a windows box and they worked...
If someone knows this is a problem, please speak up.
-Josh
#5
04/30/2005 (7:53 pm)
Try the other direction too, Windows dso's on a mac
#6
They are not 100% compatible. We had plenty of problems.
04/30/2005 (7:59 pm)
We compile our scripts on thier native platform and use those for Lore builds. Easy fix, since you should have a machine for each build type anyways. (How else does one do testing? :)They are not 100% compatible. We had plenty of problems.
#7
04/30/2005 (8:29 pm)
If there is a problem between the endian type why not recode the script compiler into storing the data in big-endian and then code the interpreter into converting over to the type which the local machine uses like many other cross platform tools and programs do. For example tetrinet server (C Linux one) stores the scores database in big-endian format and then loads them into memory in whichever format the local machine uses.
#8
04/30/2005 (8:48 pm)
One thing I noticed is that F64 doesn't have an endian safe stream function. I added one and am compiling now, will report.
#9
04/30/2005 (9:00 pm)
All this talk of Endians, and you know what? I've been programming for over 10 years and never have figured out what an Endian is. I just know it has something to do with datasize. Anyone care to clarify it for me?
#10
Woohoo!!! That was it :)
So, you just have to add a F64 endian conversion to the stream base class :)
-Josh Ritter
04/30/2005 (9:07 pm)
@Dreamer: It's just byte order, which can be different on various platforms.Woohoo!!! That was it :)
So, you just have to add a F64 endian conversion to the stream base class :)
-Josh Ritter
#11
04/30/2005 (9:10 pm)
Ok, it's on the list! Thanks Josh.
#12
edit - fix link
05/01/2005 (7:19 am)
For more information (might be too much) on Endian see Endian on Wikipediaedit - fix link
#13
05/01/2005 (10:11 am)
Woohoo! I finally get it! Thanx now I know :)
#14
07/12/2005 (1:30 pm)
Ok, made this fix to SVN. Bug #51 resolved.
#15
07/13/2005 (9:35 am)
Nice, I'll have to look at Lore and fix that there, would be nice to have a unified dso build process.
#16
engine/core/stream.h
engine/platform/platform.h
09/02/2005 (8:32 am)
Here is the actual changes since they were not actaully listed in this thread:engine/core/stream.h
// phdana droids -> DECLARE_OVERLOADED_WRITE(S8) DECLARE_OVERLOADED_WRITE(U8) //DECLARE_OVERLOADED_WRITE(F64) DECLARE_ENDIAN_OVERLOADED_WRITE(S16) DECLARE_ENDIAN_OVERLOADED_WRITE(S32) DECLARE_ENDIAN_OVERLOADED_WRITE(U16) DECLARE_ENDIAN_OVERLOADED_WRITE(U32) DECLARE_ENDIAN_OVERLOADED_WRITE(F32) DECLARE_ENDIAN_OVERLOADED_WRITE(F64) DECLARE_OVERLOADED_READ(S8) DECLARE_OVERLOADED_READ(U8) //DECLARE_OVERLOADED_READ(F64) DECLARE_ENDIAN_OVERLOADED_READ(S16) DECLARE_ENDIAN_OVERLOADED_READ(S32) DECLARE_ENDIAN_OVERLOADED_READ(U16) DECLARE_ENDIAN_OVERLOADED_READ(U32) DECLARE_ENDIAN_OVERLOADED_READ(F32) DECLARE_ENDIAN_OVERLOADED_READ(F64) // phdana droids <-
engine/platform/platform.h
//------------------------------------------------------------------------------
// Endian conversions
...
// phdana droids ->
inline F64 convertHostToLEndian(F64 i) { return i; }
inline F64 convertLEndianToHost(F64 i) { return i; }
// phdana droids <-
...
// phdana droids ->
inline U64 convertBEndianToHost(U64 i)
{
U32 *inp = (U32 *) &i;
U64 ret;
U32 *outp = (U32 *) &ret;
outp[0] = convertBEndianToHost(inp[1]);
outp[1] = convertBEndianToHost(inp[0]);
return ret;
}
inline U64 convertHostToBEndian(U64 i)
{
U32 *inp = (U32 *) &i;
U64 ret;
U32 *outp = (U32 *) &ret;
outp[0] = convertHostToBEndian(inp[1]);
outp[1] = convertHostToBEndian(inp[0]);
return ret;
}
inline F64 convertBEndianToHost(F64 in_swap)
{
U64 result = convertBEndianToHost(* ((U64 *) &in_swap) );
return * ((F64 *) &result);
}
inline F64 convertHostToBEndian(F64 in_swap)
{
U64 result = convertHostToBEndian(* ((U64 *) &in_swap) );
return * ((F64 *) &result);
}
// phdana droids <-
...
// phdana droids ->
inline U64 convertLEndianToHost(U64 i)
{
U32 *inp = (U32 *) &i;
U64 ret;
U32 *outp = (U32 *) &ret;
outp[0] = convertLEndianToHost(inp[1]);
outp[1] = convertLEndianToHost(inp[0]);
return ret;
}
inline U64 convertHostToLEndian(U64 i)
{
U32 *inp = (U32 *) &i;
U64 ret;
U32 *outp = (U32 *) &ret;
outp[0] = convertHostToLEndian(inp[1]);
outp[1] = convertHostToLEndian(inp[0]);
return ret;
}
inline F64 convertLEndianToHost(F64 in_swap)
{
U64 result = convertLEndianToHost(* ((U64 *) &in_swap) );
return * ((F64 *) &result);
}
inline F64 convertHostToLEndian(F64 in_swap)
{
U64 result = convertHostToLEndian(* ((U64 *) &in_swap) );
return * ((F64 *) &result);
}
// phdana droids <-
#17
09/02/2005 (5:21 pm)
Thanks for the follow up post, Paul! :)
#18
09/16/2005 (9:50 am)
Am I reading this right? The .dso files will be fully cross-platform in future releases (1.4+)?
#19
09/17/2005 (8:25 pm)
Yes, DSO files are fully cross platform in TGE 1.4 and later.
#20
08/16/2006 (4:10 am)
Thanks eveyone (especially Paul). It seems every problem I'm coming across in getting my TGE1.3 game to work on powerPCs is something that's fixed in TGE1.4... gah!
Torque Owner Dreamer
Default Studio Name