CLR Projects Support Forum Index
Softec Web Site CLR Projects Trac
CLR Projects Support
Support regarding Open Source projects from Softec for the Common Language Runtime
 
 FAQFAQ   Search   MemberlistMemberlist   Usergroups   Register 
 Profile   Log in to check your private messagesLog in to check your private messages   Log in 

struct packing

 
       CLR Projects Support Forum Index -> Development
View previous topic :: View next topic  
Author Message
Toby
Moderator


Joined: 02 Aug 2006
Posts: 8

Posted: Tue Jan 30, 2007 8:20 pm    Post subject: struct packing

Hello Denis, I'm wondering if you ever came up with a better solution to the problem of struct packing size differences on Mono/Linux vs. Windows? From what digging around I have done[1], this seems to be a bug in Mono in that it doesn't correctly default to that platform's packing size but always uses 8.

I would really like to not resort to a compiler directive, but since the only way to explicitly set this is with an attribute, the only other option I see is to define two classes whenever such a struct is needed and use a factory method to generate the correct one at runtime.

My goal here is to allow the same compiled assemblies to run correctly on both Linux and Windows but there doesn't seem to be a very clean way to do this.

Thanks,
toby

[1] http://lists.ximian.com/pipermail/mono-devel-list/2003-September/002030.html
Back to top
Denis
Administrator


Joined: 02 Aug 2006
Posts: 23
Location: Luxembourg

Posted: Mon Feb 05, 2007 6:18 pm    Post subject:

Hi Toby,

Well, since you have to build and provide the subversion client DLL under Windows, what I thought would be nice to do, is to have a built of this DLL that use the same packing used by Linux. This way, you can avoid the issues found under mono, by fixing structure packing to a common value for both Windows and Linux. However, I have never investigate how to force the Windows compiler to use a particular structure packing, if it is possible.

Regards,
_________________
Denis Gervalle
SOFTEC sa
Back to top
Toby
Moderator


Joined: 02 Aug 2006
Posts: 8

Posted: Mon Feb 05, 2007 7:48 pm    Post subject:

I hadn't really thought about going that route although I'm pretty sure I did see in the MS Compiler options, the ability to set the packing size. I will investigate this option, thanks...
Back to top
Display posts from previous:   
       CLR Projects Support Forum Index -> Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright © 1992-2006 SOFTEC sa. All rights reserved.
The contents of this site is the property of SOFTEC. Please consult our site disclaimer before usage.
Powered by phpBB 2.0 © 2001, 2005 phpBB Group