#include "annotate.h"
#include <sys/time.h>
-/* For Cygwin32, we use a timer to periodically check for Windows
+#ifdef __CYGWIN__
+#include <sys/cygwin.h> /* for cygwin32_attach_handle_to_fd */
+#endif
+
+/* For Cygwin, we use a timer to periodically check for Windows
messages. FIXME: It would be better to not poll, but to instead
rewrite the target_wait routines to serve as input sources.
Unfortunately, that will be a lot of work. */
* way errors will go to stdout.
*/
-extern void gdbtk_fputs PARAMS ((const char *, FILE *));
+extern void gdbtk_fputs PARAMS ((const char *, GDB_FILE *));
/* Handle for TCL interpreter */
Tcl_Interp *gdbtk_interp = NULL;
causing gdb to abort. If instead we simply return here, gdb will
gracefully degrade to using the command line interface. */
-#ifndef WINNT
+#ifndef _WIN32
if (getenv ("DISPLAY") == NULL)
return;
#endif
* These are the commands to do some Windows Specific stuff...
*/
-#ifdef __CYGWIN32__
+#ifdef __CYGWIN__
if (ide_create_messagebox_command (gdbtk_interp) != TCL_OK)
error ("messagebox command initialization failed");
/* On Windows, create a sizebox widget command */
fputs_unfiltered_hook = NULL; /* Force errors to stdout/stderr */
if (getenv("GDBTK_LIBRARY"))
{
- fprintf_unfiltered (stderr, "Unable to find main.tcl in %s\n",getenv("GDBTK_LIBRARY"));
- fprintf_unfiltered (stderr,
+ fprintf_unfiltered (gdb_stderr, "Unable to find main.tcl in %s\n",
+ getenv("GDBTK_LIBRARY"));
+ fprintf_unfiltered (gdb_stderr,
"Please set GDBTK_LIBRARY to a path that includes the GDB tcl files.\n");
}
else
{
- fprintf_unfiltered (stderr, "Unable to find main.tcl in %s\n", GDBTK_LIBRARY);
- fprintf_unfiltered (stderr, "You might want to set GDBTK_LIBRARY\n");
+ fprintf_unfiltered (gdb_stderr,
+ "Unable to find main.tcl in %s\n", GDBTK_LIBRARY);
+ fprintf_unfiltered (gdb_stderr,
+ "You might want to set GDBTK_LIBRARY\n");
}
error("");
}
/* Tell the rest of the world that Gdbtk is now set up. */
init_ui_hook = gdbtk_init;
-#ifdef __CYGWIN32__
+#ifdef __CYGWIN__
(void) FreeConsole ();
#endif
}
-#ifdef __CYGWIN32__
+#ifdef __CYGWIN__
else
{
DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE));
- void cygwin32_attach_handle_to_fd (char *, int, HANDLE, int, int);
switch (ft)
{