Kazuhiro Fujieda | 2 Jul 18:19 2006
Picon

setmetamode

Here is the patch to control the handling of the meta key with
the setmetamode command on the Cygwin console like the Linux
console.

I submitted the previous version of this patch three years ago,
but it didn't work on Corinna's environment. I, however, wasn't
able to find any reason why it didn't work, so the logic of this
patch is the same as the previous one.

May it works fine on environment other than mine.
____
  | AIST      Kazuhiro Fujieda <fujieda <at> jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology
2006-07-03  Kazuhiro Fujieda  <fujieda <at> jaist.ac.jp>

	* fhandler.h (class dev_console): Add `metabit' indicating the
	current meta key mode.
	* fhandler_console.cc (fhandler_console::read): Set the top bit of
	the character if metabit is true.
	* fhandler_console.cc (fhandler_console::ioctl): Implement
	KDGKBMETA and KDSKBMETA commands.
	* fhandler_tty.cc (process_ioctl): Support KDSKBMETA.
	(fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the
	master.
	* include/cygwin/kd.h: New file for the meta key mode.
(Continue reading)

Eric Blake | 2 Jul 23:02 2006
Picon

Fix UINT{8,16}_C


According to POSIX, UINT{8,16}_C should result in an integer constant with
"the same type as would an expression that is an object of the
corresponding type converted according to the integer promotions."  And
according to C, unsigned char promotes to signed int, when int is wider
than char.  Gnulib now tests for bugs in stdint.h, and these are the
remaining two issues that makes cygwin's version non-compliant:

2006-07-02  Eric Blake  <ebb9 <at> byu.net>

	* include/stdint.h (UINT8_C, UINT16_C): Unsigned types smaller
	than int promote to signed int.

--
Life is short - so eat dessert first!

Eric Blake             ebb9 <at> byu.net
Index: cygwin/include/stdint.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/stdint.h,v
retrieving revision 1.6
diff -u -p -r1.6 stdint.h
--- cygwin/include/stdint.h	23 May 2005 13:13:00 -0000	1.6
+++ cygwin/include/stdint.h	2 Jul 2006 21:01:39 -0000
 <at>  <at>  -1,6 +1,6  <at>  <at> 
 /* stdint.h - integer types

-   Copyright 2003 Red Hat, Inc.
(Continue reading)

Corinna Vinschen | 3 Jul 11:41 2006

Re: Fix UINT{8,16}_C

On Jul  2 15:02, Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> According to POSIX, UINT{8,16}_C should result in an integer constant with
> "the same type as would an expression that is an object of the
> corresponding type converted according to the integer promotions."  And
> according to C, unsigned char promotes to signed int, when int is wider
> than char.  Gnulib now tests for bugs in stdint.h, and these are the
> remaining two issues that makes cygwin's version non-compliant:
> [...]
>  <at>  <at>  -169,8 +169,8  <at>  <at>  typedef unsigned long long uintmax_t;
>  #define INT32_C(x) x ## L
>  #define INT64_C(x) x ## LL
>  
> -#define UINT8_C(x) x ## U
> -#define UINT16_C(x) x ## U
> +#define UINT8_C(x) x
> +#define UINT16_C(x) x
>  #define UINT32_C(x) x ## UL
>  #define UINT64_C(x) x ## ULL
>  

I have checked the stdint.h headers on glibc 2.3.4 and 2.4, as well as
on Solaris 10, NetBSD, FreeBSD and OpenBSD.  Only FreeBSD and OpenBSD
define them as just x, all others as x##U, one way or the other.

ISO/IEC 9899:TC2 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf)
has the following to say:

(Continue reading)

Corinna Vinschen | 3 Jul 13:45 2006

Re: setmetamode

On Jul  3 01:19, Kazuhiro Fujieda wrote:
> Here is the patch to control the handling of the meta key with
> the setmetamode command on the Cygwin console like the Linux
> console.
> 
> I submitted the previous version of this patch three years ago,
> but it didn't work on Corinna's environment. I, however, wasn't
> able to find any reason why it didn't work, so the logic of this
> patch is the same as the previous one.
> 
> May it works fine on environment other than mine.

It works now for me, too.  I have no idea wy it didn't work way back
when, but I don't see a reason not to include it now.

Just a questions:

You didn't add an include/sys/kd.h file.  On Linux this file in turn
includes linux/kd.h.  Is there a reason that you didn't create it?  The
cygwin/kd.h file contains only a miniscule number of definitions,
compared with the Linux version.  Do you think adding sys/kd.h would
result in problems for that reason?

Corinna

--

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

(Continue reading)

Eric Blake | 3 Jul 14:10 2006
Picon

Re: Fix UINT{8,16}_C


According to Corinna Vinschen on 7/3/2006 3:41 AM:
>   
> 
> I have checked the stdint.h headers on glibc 2.3.4 and 2.4, as well as
> on Solaris 10, NetBSD, FreeBSD and OpenBSD.  Only FreeBSD and OpenBSD
> define them as just x, all others as x##U, one way or the other.

And gnulib rejects Solaris 10 and glibc's versions as buggy as well:

http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00118.html

> 
> ISO/IEC 9899:TC2 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf)
> has the following to say:
> 
>   7.18.4.1 Macros for minimum-width integer constants
> 
>   The macro INTN_C(value) shall expand to an integer constant expression
>   corresponding to the type int_leastN_t.

The problem is that there is no integer constant expression for unsigned
char; instead, you get an integer constant expression for the type that
unsigned char promotes to.  Therefore, UINT8_C should give an int, not
unsigned int.

This snippet from gnulib is valid C code, but fails if you use the wrong
type specifier:

  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
(Continue reading)

Corinna Vinschen | 3 Jul 14:31 2006

Re: Fix UINT{8,16}_C

On Jul  3 06:10, Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> According to Corinna Vinschen on 7/3/2006 3:41 AM:
> >   
> > 
> > I have checked the stdint.h headers on glibc 2.3.4 and 2.4, as well as
> > on Solaris 10, NetBSD, FreeBSD and OpenBSD.  Only FreeBSD and OpenBSD
> > define them as just x, all others as x##U, one way or the other.
> 
> And gnulib rejects Solaris 10 and glibc's versions as buggy as well:
> 
> http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00118.html
> 
> > 
> > ISO/IEC 9899:TC2 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf)
> > has the following to say:
> > 
> >   7.18.4.1 Macros for minimum-width integer constants
> > 
> >   The macro INTN_C(value) shall expand to an integer constant expression
> >   corresponding to the type int_leastN_t.
> 
> The problem is that there is no integer constant expression for unsigned
> char; instead, you get an integer constant expression for the type that
> unsigned char promotes to.  Therefore, UINT8_C should give an int, not
> unsigned int.
> 
> This snippet from gnulib is valid C code, but fails if you use the wrong
(Continue reading)

Kazuhiro Fujieda | 3 Jul 15:26 2006
Picon

Re: setmetamode

>>> On Mon, 03 Jul 2006 13:45:22 +0200
>>> Corinna Vinschen <corinna-cygwin <at> cygwin.com> said:

> You didn't add an include/sys/kd.h file.  On Linux this file in turn
> includes linux/kd.h.  Is there a reason that you didn't create it?

No. I just forgot it.
____
  | AIST      Kazuhiro Fujieda <fujieda <at> jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology
/* sys/kd.h

   Copyright 2006 Red Hat, Inc.

   Written by Kazuhiro Fujieda <fujieda <at> jaist.ac.jp>

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

/* sys/kd.h header file for Cygwin.  */

#ifndef _SYS_KD_H
#define _SYS_KD_H

(Continue reading)

Corinna Vinschen | 3 Jul 17:30 2006

Re: setmetamode

On Jul  3 22:26, Kazuhiro Fujieda wrote:
> >>> On Mon, 03 Jul 2006 13:45:22 +0200
> >>> Corinna Vinschen <corinna-cygwin <at> cygwin.com> said:
> 
> > You didn't add an include/sys/kd.h file.  On Linux this file in turn
> > includes linux/kd.h.  Is there a reason that you didn't create it?
> 
> No. I just forgot it.

No worries.  I've applied the patch with minor changes (copyright dates,
comments).

Thanks,
Corinna

--

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

SUZUKI Hisao | 6 Jul 02:24 2006

Re: UTF-8 Cygwin

Christopher Faylor wrote:
> On Tue, Jun 27, 2006 at 02:46:56PM +0900, SUZUKI Hisao wrote:
>> # I should have posted this message to this list from the first.
>>
>> I made a patch to cygwin1.dll to support UTF-8.
>>
>> It allows you to use all of characters and file (or path) names
>> allowed in Windows, while keeping binary-compatibility with the
>> current Cygwin.  It is fairly perfect except for lack of locale
>> support etc.  So it may remind you of the good old BeOS.  See:
>>
>> http://www.okisoft.co.jp/esc/utf8-cygwin/
> 
> Yes, we heard.
> 
> The contribution guidelines are here:
> 
> http://cygwin.com/contrib.html
> 
> We'd appreciate if you could give them a look and use them as the basis
> for your contribution.  The first step is that you'll need to fill out
> an assignment form.
> 
> cgf

Yes, I have filled out the assignment form and have sent it to Red
Hat.  I hope you can adopt and adapt the patch without any legal
fears now ;-).

P.S.
(Continue reading)

SUZUKI Hisao | 6 Jul 08:28 2006

Re: UTF-8 Cygwin

Larry Hall wrote:
> SUZUKI Hisao wrote:
[snip]
>>
>> Yes, I have filled out the assignment form and have sent it to Red
>> Hat.  I hope you can adopt and adapt the patch without any legal
>> fears now ;-).
>>
>>
>> P.S.
>>
>> Based on Cygwin 1.5.20-1, I have updated the UTF-8 patch.
>>
>> In fact, I have just "diff -c"'ed the old ones and have patch'ed the
>> results to cygwin-1.5.20-1-src, except for sys_wcstombs() in
>> miscfuncs.cc.  Its definition differs from what is in cygwin-1.5.19-4.
>> I have just done a few lines of tweaks on it.
>>
>> Though I have not looked into the details yet, it seems working fine.
>> Please try it:

You know the modified source has been available here from the very first:

>> http://www.okisoft.co.jp/esc/utf8-cygwin/
 >
> Sounds like things are all moving in the right direction!  Once you receive
> the "OK" from Corinna (indicating that your assignment form has arrived at
> Red Hat's headquarters), you'll want to generate a patch to submit to this
> list for discussion/approval.  The details of this process are described 
> here:
(Continue reading)


Gmane