public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Patch: fix tk so that it compiles under mingw
@ 2002-11-10 10:49 Mo DeJong
  2002-11-22 12:43 ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Mo DeJong @ 2002-11-10 10:49 UTC (permalink / raw)
  To: Insight

Here is a minor patch that allows Tk to be compiled under mingw.

cheers
Mo

2002-11-09  Mo DeJong  <mdejong@uncounted.org>

	* win/tkWinDialog.c (ChooseDirectoryHookProc):
	Use the _T macro instead of __TEXT since it
	works with VC++ and mingw. Newer releases of
	Tk make use of _T.

Index: win/tkWinDialog.c
===================================================================
RCS file: /cvs/src/src/tk/win/tkWinDialog.c,v
retrieving revision 1.4
diff -u -r1.4 tkWinDialog.c
--- win/tkWinDialog.c	24 Sep 2002 18:39:30 -0000	1.4
+++ win/tkWinDialog.c	10 Nov 2002 01:41:34 -0000
@@ -1523,7 +1523,7 @@
 		     * Directory must exist.  Complain, then rehighlight text.
 		     */
 
-		    wsprintf(tmp, __TEXT("Cannot change directory to \"%.200s\"."), 
+		    wsprintf(tmp, _T("Cannot change directory to \"%.200s\"."), 
 			    cdPtr->path);
 		    MessageBox(hwnd, tmp, NULL, MB_OK);
 		    SendDlgItemMessage(hwnd, edt10, EM_SETSEL, 0, -1);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: fix tk so that it compiles under mingw
  2002-11-10 10:49 Patch: fix tk so that it compiles under mingw Mo DeJong
@ 2002-11-22 12:43 ` Keith Seitz
  2003-01-14  1:26   ` Mo DeJong
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Seitz @ 2002-11-22 12:43 UTC (permalink / raw)
  To: Mo DeJong; +Cc: Insight

On Sun, 10 Nov 2002, Mo DeJong wrote:

> Index: win/tkWinDialog.c
> ===================================================================
> RCS file: /cvs/src/src/tk/win/tkWinDialog.c,v
> retrieving revision 1.4
> diff -u -r1.4 tkWinDialog.c
> --- win/tkWinDialog.c	24 Sep 2002 18:39:30 -0000	1.4
> +++ win/tkWinDialog.c	10 Nov 2002 01:41:34 -0000
> @@ -1523,7 +1523,7 @@
>  		     * Directory must exist.  Complain, then rehighlight text.
>  		     */
>  
> -		    wsprintf(tmp, __TEXT("Cannot change directory to \"%.200s\"."), 
> +		    wsprintf(tmp, _T("Cannot change directory to \"%.200s\"."), 
>  			    cdPtr->path);
>  		    MessageBox(hwnd, tmp, NULL, MB_OK);
>  		    SendDlgItemMessage(hwnd, edt10, EM_SETSEL, 0, -1);

This patch does not build:

Creating library file: libcygtk83.a
tkWinDIalog.o(.text+0x25a9): In function `ChooseDirectoryHookProc':
/home/keiths/ref/cygwin/tk/win/../../../src/tk/win/tkWinDialog.c:1526: 
undefined reference to `__T'
collect2: ld returned 1 exit status

This is with gcc 3.2 20020927 (latest from setup).

Keith


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: fix tk so that it compiles under mingw
  2002-11-22 12:43 ` Keith Seitz
@ 2003-01-14  1:26   ` Mo DeJong
  0 siblings, 0 replies; 3+ messages in thread
From: Mo DeJong @ 2003-01-14  1:26 UTC (permalink / raw)
  To: insight

On Fri, 22 Nov 2002 12:43:11 -0800 (PST)
Keith Seitz <keiths@redhat.com> wrote:

> This patch does not build:
> 
> Creating library file: libcygtk83.a
> tkWinDIalog.o(.text+0x25a9): In function `ChooseDirectoryHookProc':
> /home/keiths/ref/cygwin/tk/win/../../../src/tk/win/tkWinDialog.c:1526: 
> undefined reference to `__T'
> collect2: ld returned 1 exit status

I just tried this myself and it looks like _T is defined in the tchar.h file for
Mingw. Since this is not used in Cygwin, it seems like to right thing to
do is use the TEXT() macro instead. The headers state that __TEXT should
not be used, so this seems better.

2003-01-13  Mo DeJong  <mdejong@uncounted.org>

	* win/tkWinDialog.c (ChooseDirectoryHookProc):
	Use TEXT macro instead of __TEXT, this should
	work with VC++, Mingw, and Cygwin.

Index: win/tkWinDialog.c
===================================================================
RCS file: /cvs/src/src/tk/win/tkWinDialog.c,v
retrieving revision 1.4
diff -u -r1.4 tkWinDialog.c
--- win/tkWinDialog.c	24 Sep 2002 18:39:30 -0000	1.4
+++ win/tkWinDialog.c	14 Jan 2003 01:10:19 -0000
@@ -1523,7 +1523,7 @@
 		     * Directory must exist.  Complain, then rehighlight text.
 		     */
 
-		    wsprintf(tmp, __TEXT("Cannot change directory to \"%.200s\"."), 
+		    wsprintf(tmp, TEXT("Cannot change directory to \"%.200s\"."), 
 			    cdPtr->path);
 		    MessageBox(hwnd, tmp, NULL, MB_OK);
 		    SendDlgItemMessage(hwnd, edt10, EM_SETSEL, 0, -1);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-14  1:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-10 10:49 Patch: fix tk so that it compiles under mingw Mo DeJong
2002-11-22 12:43 ` Keith Seitz
2003-01-14  1:26   ` Mo DeJong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).