[m-rev.] for review: unicode command line arguments on windows

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Dec 15 17:32:06 AEDT 2011


On Thu, 15 Dec 2011, Peter Wang wrote:

> On Thu, 15 Dec 2011 16:46:22 +1100 (EST), Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>>
>> Unfortunately it didn't help much :-(
>>
>> mslice_init.obj : error LNK2019: unresolved external symbol
>> __imp__CommandLineToArgvW at 8 reference in function _mercury_win32_args
>
> That looks like it came from the previous version of mkinit.
>
>>> For MSVC we have the option of using
>>>    wmain(int argc, wchar_t *argv[], wchar_t *envp[])
>>
>> Perhaps the best thing to do is just
>>
>>    #if defined(MR_MSVC)
>>       wmain(...)
>>    #else
>>       main(...) + call mercury_win32_args on argv in this case
>>    #endif
>>
>> (It looks as though mingw-gcc doesn't support wmain.)
>
> Yes, otherwise I would have used wmain to begin with.
>
> How do you want to proceed?  I could modify my patch to be conditional
> on MR_MINGW and commit it, then let you handle the changes for MSVC.

Ok, let me try and get this straight:

(1) __wgetmainargs works with MinGW
(2) wmain works with MSVC

So let's do that - I would actually make the code conditional on MR_MSVC
rather than MR_MINGW though.  I suggest breaking mercury_win32_args in
two since the lower part of it should be usable by both of them.

> It's probably better for you to modify the patch and commit it directly.

That's fine with me.

> And what about cygwin?

I'm not sure at the moment - I will need to look into it.
In the worst case, the Cygwin port can just fall back to not supporting
Unicode command line arguments for now; it isn't as important as the
other two ports anyway.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list