delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/06/16/18:41:17

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type; q=dns; s=default; b=Bpv08R
bJF10bDn0hnAPttSESWWd1yA06aEmJo7gkWwkzK0E3LTGEoIFE6/KqanujzRg/Gu
a09AVL2Mg7Ii4WeNVS9J5NxfBU0eUh8wRGW9fFKul+UKLOW5wgDnD9908JLvFW2Z
yunI5kZ5w2NVylFENQuVbsBXzrDasB1jKEniE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type; s=default; bh=ypDgZRYp53v8
9rjhzRckjnR39qM=; b=Hdb1RLqjtQv7I8J8atx9iCmAYqXsWCWwjB/28iTj2MLc
6HlhtjJO/kbHYHt0wI0FjWi3eXQQpJCi+Z/xRV9V+2ReNzOlthybicFGyen5UDkw
RY4JLojKsipbmggUQl/So7q0mhAR0MaARe/6ti41XaUaNDddUMIN4iSialKtswM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-pa0-f54.google.com
X-Received: by 10.70.91.206 with SMTP id cg14mr4720692pdb.158.1434494456884; Tue, 16 Jun 2015 15:40:56 -0700 (PDT)
Message-ID: <5580A5C0.9000303@gmail.com>
Date: Wed, 17 Jun 2015 06:40:00 +0800
From: JonY <10walls AT gmail DOT com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:24.0) Gecko/20140503 FossaMail/24.5.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, Kai Tietz <ktietz70 AT googlemail DOT com>
Subject: Re: Recent cygwin update is missing tchar header file
References: <loom DOT 20150613T183650-316 AT post DOT gmane DOT org> <20150615164113 DOT GX31537 AT calimero DOT vinschen DOT de> <557F50B8 DOT 6010703 AT gmail DOT com> <20150616093424 DOT GA31537 AT calimero DOT vinschen DOT de>
In-Reply-To: <20150616093424.GA31537@calimero.vinschen.de>
X-IsSubscribed: yes

--DWcXrmT5E4RtlBeXHCwGdbAtHDDa1lki4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 6/16/2015 17:34, Corinna Vinschen wrote:
> On Jun 16 06:24, JonY wrote:
>> On 6/16/2015 00:41, Corinna Vinschen wrote:
>>> Hi Jon,
>>>
>>> any idea what happened to tchar.h in the latest w32api update?
>>>
>>
>> tchar.h seems to be part of the CRT headers rather than the w32api
>> headers. I'll see getting it installed regardless.
>=20
> Hmm, that may not be as easy as it sounds.
>=20
> I checked the w32api-headers 3.3 0 version and there was no tchar.h in
> it either, so this isn't new.  I assume the last time the package has
> been built successfully was against w32api headers from Mingw.org.
>=20
> tchar.h in Mingw-w64 pulls a rat tail of other headers in:
>=20
>   $ grep '#include' tchar.h=20
>   #include <crtdefs.h>
>   #include <wchar.h>
>   #include <string.h>
>   #include <mbstring.h>
>   #include <sec_api/tchar_s.h>
>=20
> AFAICS, oledlg.h pulls in tchar.h
> solely to get the definition of the macro _TEXT.
>=20
> So we are better off to define our own tchar.h, or, even better, to
> tweak tchar.h for Cygwin upstream.  If we exclude everything except for
> the definitions of _T, _TEXT, _TEOF, and the types like _TCHAR etc., we
> should be good.
>=20
> Something like this (untested):
>=20
> diff --git a/mingw-w64-headers/crt/tchar.h b/mingw-w64-headers/crt/tchar.h
> index 3567085..c82634a 100644
> --- a/mingw-w64-headers/crt/tchar.h
> +++ b/mingw-w64-headers/crt/tchar.h
> @@ -16,6 +16,8 @@
>  extern "C" {
>  #endif
>=20=20
> +#ifndef __CYGWIN__
> +
>  #define _ftcscat _tcscat
>  #define _ftcschr _tcschr
>  #define _ftcscpy _tcscpy
> @@ -79,6 +81,8 @@ extern "C" {
>=20=20
>  #define _WConst_return _CONST_RETURN
>=20=20
> +#endif /* __CYGWIN__ */
> +
>  #ifdef _UNICODE
>=20=20
>  #ifdef __cplusplus
> @@ -91,12 +95,16 @@ extern "C" {
>  extern "C" {
>  #endif
>=20=20
> +#ifndef __CYGWIN__
> +
>  #ifndef _WCTYPE_T_DEFINED
>  #define _WCTYPE_T_DEFINED
>    typedef unsigned short wint_t;
>    typedef unsigned short wctype_t;
>  #endif
>=20=20
> +#endif /* __CYGWIN__ */
> +
>  #ifndef __TCHAR_DEFINED
>  #define __TCHAR_DEFINED
>    typedef wchar_t _TCHAR;
> @@ -118,6 +126,8 @@ extern "C" {
>=20=20
>  #define __T(x) L##x
>=20=20
> +#ifndef __CYGWIN__
> +
>  #define _tmain wmain
>  #define _tWinMain wWinMain
>  #define _tenviron _wenviron
> @@ -470,6 +480,8 @@ extern "C" {
>  #define _ttelldir	_wtelldir
>  #define _tseekdir	_wseekdir
>=20=20
> +#endif /* __CYGWIN__ */
> +
>  #else
>=20=20
>  #ifdef __cplusplus
> @@ -486,6 +498,8 @@ extern "C" {
>=20=20
>  #define __T(x) x
>=20=20
> +#ifndef __CYGWIN__
> +
>  #define _tmain main
>  #define _tWinMain WinMain
>  #ifdef _POSIX_
> @@ -733,12 +747,16 @@ extern "C" {
>=20=20
>  #define _tsetlocale setlocale
>=20=20
> +#endif /* __CYGWIN__ */
> +
>  #ifdef _MBCS
>=20=20
>  #ifdef __cplusplus
>  }
>  #endif
>=20=20
> +#ifndef __CYGWIN__
> +
>  #include <mbstring.h>
>=20=20
>  #ifdef __cplusplus
> @@ -939,6 +957,9 @@ extern "C" {
>  #define _istlead _ismbblead
>  #define _istleadbyte isleadbyte
>  #define _istleadbyte_l _isleadbyte_l
> +
> +#endif /* __CYGWIN__ */
> +
>  #else
>=20=20
>  #ifndef __TCHAR_DEFINED
> @@ -958,6 +979,8 @@ extern "C" {
>  #endif
>  #endif
>=20=20
> +#ifndef __CYGWIN__
> +
>  #define _tcschr strchr
>  #define _tcscspn strcspn
>  #define _tcsncat strncat
> @@ -1096,6 +1119,8 @@ extern "C" {
>  #endif
>  #endif
>=20=20
> +#endif /* __CYGWIN__ */
> +
>  #define _T(x) __T(x)
>  #define _TEXT(x) __T(x)
>=20=20
> @@ -1103,5 +1128,7 @@ extern "C" {
>  }
>  #endif
>=20=20
> +#ifndef __CYGWIN__
>  #include <sec_api/tchar_s.h>
> +#endif /* __CYGWIN__ */
>  #endif
>=20
>=20
> Corinna
>=20

Kai, Ping.



--DWcXrmT5E4RtlBeXHCwGdbAtHDDa1lki4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIcBAEBAgAGBQJVgKXIAAoJEHE7X+KcFF1Fp3AQAIGJD6h4dAP2nTIw4fTFpGBl
rWfh98Kx8SJLoptqoqU0fNBdtEjb0+0FKObwzj36OBoEaYf4gMCaZFOMPrgigCXN
ZBMDYlYo4Cbxn3cmhFRYa+U46UjxT1VvkpKf1Dbxdfvl/rQfCTBT6UKmq/nVgOGJ
a8fvmK04vgsF5gOz2s1qG+5mUU6LprYfl3JNiHUA5fWutxfWs5Eq2udclkWrDT6W
y8AwXDhdiEkpbRBCHjd11nakbhtHWgaejdIwvQo6UByWgYSWfS7lgQaQiq46sbi5
97nyNMvLC330YKtTMqS3sFqK1BuYNYFeXAF+Td9lpp7hiL3NacWTb7E+ctttK5nb
vysjMrmsp1GNZZmT5k8GtlAUKlnXYYG0PH6LYUhVqpAdoDnHVbqqfzxaWxPExjNb
lOgoIdsKMP2hr43YDddIpDzU8HgIecaFk2JVhLfx62IMlZaKHqKT7yuR2Zi2ppZP
XKrIT6HUW+tvWiRbtxLuzyXQcTGiG0jaaAlJIvAb6FzYjnICNvijn/WcSaMJ2oKC
Ac0fvPFaP+So5DiK5fJ70+KK634/fSt2KJruZQDTRl9LH9NfSYNgLNP/AaEfv2Nr
+9DDQaEnnYr2dA5BADQ5oy+tN1zwUbgzUrHGEJ0KfxNz2E2bhLo34KH+BGr3yUQ0
xMC6VL00QtoWGsWz8VzM
=PQkB
-----END PGP SIGNATURE-----

--DWcXrmT5E4RtlBeXHCwGdbAtHDDa1lki4--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019