delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/06/16/05:34:44

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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=XC+JktBX0kj0nf8myHdR3lrJtx6gM1riZIGz3kHDcScQwPxDmzT9E
QbeWNn/b9En7EScUv815nED2nl1TBR4howwKRXLqk0NTUAkW500y+5dt7ZDq7WX3
X6gGQHjdHQi+gOQF9RgHvcYCDZENG2E+hX8MaPh9uDx8UVgFLk8dC8=
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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=Xf6nfCihFi+iW43LWEgVzpd8D+g=; b=Cybjp2y8EUfbGqAZv8sy/1+V+Tgw
XONSnMq1nWB7hWq4fcbXsi98InX/Vn+EvM2huZ/1BIFBeATT4Hu9YQe7Rig1LNMd
XsJa8qtRCzcVmjk2niZ6wGUvecRFupg9QmP9lD0JkbXv8ZdK+rd8fiTDSoLvB5g9
TMlWTZrs1v3NAh0=
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=-4.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Tue, 16 Jun 2015 11:34:24 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Recent cygwin update is missing tchar header file
Message-ID: <20150616093424.GA31537@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
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>
MIME-Version: 1.0
In-Reply-To: <557F50B8.6010703@gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)

--psiTe9LjpVyD9953
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Jun 16 06:24, JonY wrote:
> On 6/16/2015 00:41, Corinna Vinschen wrote:
> > Hi Jon,
> >=20
> > any idea what happened to tchar.h in the latest w32api update?
> >=20
>=20
> tchar.h seems to be part of the CRT headers rather than the w32api
> headers. I'll see getting it installed regardless.

Hmm, that may not be as easy as it sounds.

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.

tchar.h in Mingw-w64 pulls a rat tail of other headers in:

  $ grep '#include' tchar.h=20
  #include <crtdefs.h>
  #include <wchar.h>
  #include <string.h>
  #include <mbstring.h>
  #include <sec_api/tchar_s.h>

AFAICS, oledlg.h pulls in tchar.h
solely to get the definition of the macro _TEXT.

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.

Something like this (untested):

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
+#ifndef __CYGWIN__
+
 #define _ftcscat _tcscat
 #define _ftcschr _tcschr
 #define _ftcscpy _tcscpy
@@ -79,6 +81,8 @@ extern "C" {
=20
 #define _WConst_return _CONST_RETURN
=20
+#endif /* __CYGWIN__ */
+
 #ifdef _UNICODE
=20
 #ifdef __cplusplus
@@ -91,12 +95,16 @@ extern "C" {
 extern "C" {
 #endif
=20
+#ifndef __CYGWIN__
+
 #ifndef _WCTYPE_T_DEFINED
 #define _WCTYPE_T_DEFINED
   typedef unsigned short wint_t;
   typedef unsigned short wctype_t;
 #endif
=20
+#endif /* __CYGWIN__ */
+
 #ifndef __TCHAR_DEFINED
 #define __TCHAR_DEFINED
   typedef wchar_t _TCHAR;
@@ -118,6 +126,8 @@ extern "C" {
=20
 #define __T(x) L##x
=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
+#endif /* __CYGWIN__ */
+
 #else
=20
 #ifdef __cplusplus
@@ -486,6 +498,8 @@ extern "C" {
=20
 #define __T(x) x
=20
+#ifndef __CYGWIN__
+
 #define _tmain main
 #define _tWinMain WinMain
 #ifdef _POSIX_
@@ -733,12 +747,16 @@ extern "C" {
=20
 #define _tsetlocale setlocale
=20
+#endif /* __CYGWIN__ */
+
 #ifdef _MBCS
=20
 #ifdef __cplusplus
 }
 #endif
=20
+#ifndef __CYGWIN__
+
 #include <mbstring.h>
=20
 #ifdef __cplusplus
@@ -939,6 +957,9 @@ extern "C" {
 #define _istlead _ismbblead
 #define _istleadbyte isleadbyte
 #define _istleadbyte_l _isleadbyte_l
+
+#endif /* __CYGWIN__ */
+
 #else
=20
 #ifndef __TCHAR_DEFINED
@@ -958,6 +979,8 @@ extern "C" {
 #endif
 #endif
=20
+#ifndef __CYGWIN__
+
 #define _tcschr strchr
 #define _tcscspn strcspn
 #define _tcsncat strncat
@@ -1096,6 +1119,8 @@ extern "C" {
 #endif
 #endif
=20
+#endif /* __CYGWIN__ */
+
 #define _T(x) __T(x)
 #define _TEXT(x) __T(x)
=20
@@ -1103,5 +1128,7 @@ extern "C" {
 }
 #endif
=20
+#ifndef __CYGWIN__
 #include <sec_api/tchar_s.h>
+#endif /* __CYGWIN__ */
 #endif


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--psiTe9LjpVyD9953
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVf+2gAAoJEPU2Bp2uRE+g6MAQAJnnHzRJDlKEUAug4pKpOfgE
E65CHHtjxGAHKsiWZP4cl4amApDTx/ibaqlAVdDy3CM1u5pUTziZ/fZMz1FfI0zS
vaGtJ4m83T1P41lgeUFKWmOAd7Pe1wDWrs+3AYXE3UUx51C1AYMcjmzSTeqVhhms
XYYKoHJ76FFpXqnd+huiiZ1vyY6335ZukpFkaoJCSD6MKDKQVM9ymxGqdoLrndNg
ykgmTSS1v/sA+xuMc2e5r7YtD6gIy9GfMEPLRT7VXM2jIXgWMmM+Np5k27JfdUlA
lZy21DZGqE7BVajo1eeKBph3BXDLKYHFOYN49IAQ4eFoNSpptjixUb3lMp07NcZ0
cP7bxy35bWxPcdiWlgd8MuJKRpWAWXg8qLvpUKDzenFEskJHNgv4g7EMISCEpKIx
ptgEA4h5sX9Zxz+Ltchm8j4Os9m3b/Q1zjCaCdzUWGZlQcT0Cvprxgl5d8R+hqG9
Gh+7yAIWLWYgNIsfTs4QUhiZasW/m4F5Osnon2FwXrvgNuKgjOFt8SWcrjm/VviP
8SNxo9nyl9MTg5EbC6jNT/cNMoRpXN05z75SD+kyHPnTs3hfrEgQ8+yyHhTRExaV
KZPcoYxpvxp+c6aafSgy1GHsafnSWr6Tjgckpdj1LrIrsBg0kDLaoslfcwHYmpPS
5ldteABfAFSGxkmYXM2G
=XBiP
-----END PGP SIGNATURE-----

--psiTe9LjpVyD9953--

- Raw text -


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