Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds

Christopher Faylor
2010-03-04T15:24:42Z

On Thu, Mar 04, 2010 at 10:34:06AM +0100, Corinna Vinschen wrote:
>On Mar 3 14:15, Tom Tromey wrote:
>> >>>>> "Corinna" == Corinna Vinschen <vinschen@redhat.com> writes:
>>
>> Corinna> Maybe something along these lines would help (untested!):
>>
>> I'm adding the appended to my local patch.
>> This is just your patch with the new global put closer to the code, and
>> a different preprocessor check.
>>
>> Let me know if this seems wrong somehow.
>>
>> Tom
>>
>> diff --git a/gdb/charset.c b/gdb/charset.c
>> index 21c4306..9c1e7f4 100644
>> --- a/gdb/charset.c
>> +++ b/gdb/charset.c
>> @@ -930,6 +930,15 @@ _initialize_charset (void)
>> if (!strcmp (auto_host_charset_name, "646") || !*auto_host_charset_name)
>> auto_host_charset_name = "ASCII";
>> auto_target_charset_name = auto_host_charset_name;
>> +#elif defined (USE_WIN32API)
>> + {
>> + static w32_host_default_charset[16]; /* "CP" + x<=5 digits + paranoia. */
>> +
>> + snprintf (w32_host_default_charset, sizeof w32_host_default_charset,
>> + "CP%d", GetACP());
>> + auto_host_charset_name = w32_host_default_charset;
>> + auto_target_charset_name = auto_host_charset_name;
>> + }
>> #endif
>> #endif
>
>Looks good to me.

I don't know if I get to approve this but if it looks ok to Corinna, it's ok
with me. I'm not too wide character set literate.

cgf