From 608506ed674285b7c6dc61e0bdbe9e8c473c0e7b Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 5 Apr 2001 02:02:13 +0000 Subject: * main.c: Remove windows.h use. (gdbtk_test): Use PATH_MAX for home var calculation. * remote-e7000.c (e7000_parse_device): Accomodate Cygwin as well as Win32 in test. * ser-tcp.c: Use modern __CYGWIN__ conditional. * source.c (mod_path): Add __CYGWIN__ conditional to WIN32 test. (openp): Ditto. * symfile.c (symfile_bfd_open): Ditto. * gdbtk/generic/gdbtk.c: Ditto. --- gdb/ChangeLog | 12 ++++++++++++ gdb/main.c | 5 ++--- gdb/remote-e7000.c | 2 +- gdb/ser-tcp.c | 2 +- gdb/source.c | 6 +++--- gdb/symfile.c | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 47ce9fc..3d0a2fc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +Wed Apr 4 21:48:42 2001 Christopher Faylor + + * main.c: Remove windows.h use. + (gdbtk_test): Use PATH_MAX for home var calculation. + * remote-e7000.c (e7000_parse_device): Accomodate Cygwin as well as + Win32 in colon test. + * ser-tcp.c: Use modern __CYGWIN__ conditional. + * source.c (mod_path): Add __CYGWIN__ conditional to WIN32 test. + (openp): Ditto. + * symfile.c (symfile_bfd_open): Ditto. + * gdbtk/generic/gdbtk.c: Ditto. + 2001-04-04 Martin M. Hunt * main.c (captured_main): For GDBtk, don't use tui_fileopen(). diff --git a/gdb/main.c b/gdb/main.c index 2b70712..ceac132 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -91,7 +91,6 @@ extern int enable_external_editor; extern char *external_editor_command; #ifdef __CYGWIN__ -#include /* for MAX_PATH */ #include /* for cygwin32_conv_to_posix_path */ #endif @@ -535,13 +534,13 @@ extern int gdbtk_test (char *); *before* all the command line arguments are processed; it sets global parameters, which are independent of what file you are debugging or what directory you are in. */ -#ifdef __CYGWIN32__ +#ifdef __CYGWIN__ { char *tmp = getenv ("HOME"); if (tmp != NULL) { - homedir = (char *) alloca (MAX_PATH + 1); + homedir = (char *) alloca (PATH_MAX + 1); cygwin32_conv_to_posix_path (tmp, homedir); } else diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c index 46fb54b..10a329a 100644 --- a/gdb/remote-e7000.c +++ b/gdb/remote-e7000.c @@ -543,7 +543,7 @@ or \t\ttarget e7000 tcp_remote [:]\n\ or \t\ttarget e7000 pc\n"); } -#if !defined(__GO32__) && !defined(_WIN32) +#if !defined(__GO32__) && !defined(_WIN32) && !defined(__CYGWIN__) /* FIXME! test for ':' is ambiguous */ if (n == 1 && strchr (dev_name, ':') == 0) { diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 7f6b65a..d7eb9cb 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -29,7 +29,7 @@ #include #include #include -#ifndef __CYGWIN32__ +#ifndef __CYGWIN__ #include #endif diff --git a/gdb/source.c b/gdb/source.c index d3ae4e4..9a6d60d 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -331,7 +331,7 @@ mod_path (char *dirname, char **which_path) } if (!(SLASH_P (*name) && p <= name + 1) /* "/" */ -#if defined(_WIN32) || defined(__MSDOS__) +#if defined(_WIN32) || defined(__MSDOS__) || defined(__CYGWIN__) /* On MS-DOS and MS-Windows, h:\ is different from h: */ && !(!SLASH_P (*name) && ROOTED_P (name) && p <= name + 3) /* d:/ */ #endif @@ -370,7 +370,7 @@ mod_path (char *dirname, char **which_path) if (name[0] == '~') name = tilde_expand (name); -#if defined(_WIN32) || defined(__MSDOS__) +#if defined(_WIN32) || defined(__MSDOS__) || defined(__CYGWIN__) else if (ROOTED_P (name) && p == name + 2) /* "d:" => "d:." */ name = concat (name, ".", NULL); #endif @@ -526,7 +526,7 @@ openp (char *path, int try_cwd_first, char *string, int mode, int prot, if (!path) path = "."; -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) mode |= O_BINARY; #endif diff --git a/gdb/symfile.c b/gdb/symfile.c index 1166eea..b644af8 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1052,7 +1052,7 @@ symfile_bfd_open (char *name) /* Look down path for it, allocate 2nd new malloc'd copy. */ desc = openp (getenv ("PATH"), 1, name, O_RDONLY | O_BINARY, 0, &absolute_name); -#if defined(__GO32__) || defined(_WIN32) +#if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__) if (desc < 0) { char *exename = alloca (strlen (name) + 5); -- cgit v1.1