[Mono-list] Wrapper additions
Paolo Molaro
lupus@debian.org
Thu, 20 Sep 2001 11:40:48 +0200
On 09/20/01 Dietmar Maurer wrote:
> Yes, looks better ;-) Please commit. Although I think returning a String
> will not work with our current PInvoke implementation. Does that work on
> M$ platform without problems (is the code tested)?
I think we shouldn't use the string type to pass char* data back and forth
to unix APIs. The problem is: string is supposed to be unicode chars, but
what encoding does that API use? latin1? utf8? We don't know and the lame
attribute MS added (CHAR_SET_ANSI) is only usable with their APIs.
We should probably use byte[] and have the caller decide the proper encoding.
Comments welcome.
> > +int
> > +mono_wrapper_opendir (const char * path)
> > +{
> > + return (int)opendir(path);
> > +}
opendir () return a pointer and you can't cast it (portably) to
an int. Use gpointer (the same issue is in mono_wrapper_getenv and
mono_wrapper_environ).
lupus
--
-----------------------------------------------------------------
lupus@debian.org debian/rules
lupus@ximian.com Monkeys do it better