Skip to content

Commit

Permalink
Do not use HAVE_DOS_BASED_FILE_SYSTEM for Cygwin.
Browse files Browse the repository at this point in the history
	PR gcov-profile/94570
	* ltmain.sh: Do not define HAVE_DOS_BASED_FILE_SYSTEM
	for CYGWIN.

	PR gcov-profile/94570
	* coverage.c (coverage_init): Use separator properly.

	PR gcov-profile/94570
	* filenames.h (defined): Do not define HAVE_DOS_BASED_FILE_SYSTEM
	for CYGWIN.

Co-Authored-By: Jonathan Yong <[email protected]>
  • Loading branch information
marxin and jon-y committed Apr 17, 2020
1 parent 61b58e7 commit e9f799d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2020-04-17 Martin Liska <[email protected]>
Jonathan Yong <[email protected]>

PR gcov-profile/94570
* ltmain.sh: Do not define HAVE_DOS_BASED_FILE_SYSTEM
for CYGWIN.

2020-04-14 Martin Jambor <[email protected]>

* MAINTAINERS (Reviewers): Add myself as callgraph (IPA) reviewer.
Expand Down
6 changes: 6 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2020-04-17 Martin Liska <[email protected]>
Jonathan Yong <[email protected]>

PR gcov-profile/94570
* coverage.c (coverage_init): Use separator properly.

2020-04-16 Peter Bergner <[email protected]>

PR rtl-optimization/93974
Expand Down
12 changes: 6 additions & 6 deletions gcc/coverage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,11 @@ coverage_obj_finish (vec<constructor_elt, va_gc> *ctor)
void
coverage_init (const char *filename)
{
#if HAVE_DOS_BASED_FILE_SYSTEM
const char *separator = "\\";
#else
const char *separator = "/";
#endif
int len = strlen (filename);
int prefix_len = 0;

Expand All @@ -1216,11 +1221,6 @@ coverage_init (const char *filename)
of filename in order to prevent file path clashing. */
if (profile_data_prefix)
{
#if HAVE_DOS_BASED_FILE_SYSTEM
const char *separator = "\\";
#else
const char *separator = "/";
#endif
filename = concat (getpwd (), separator, filename, NULL);
if (profile_prefix_path)
{
Expand Down Expand Up @@ -1252,7 +1252,7 @@ coverage_init (const char *filename)
if (profile_data_prefix)
{
memcpy (da_file_name, profile_data_prefix, prefix_len);
da_file_name[prefix_len++] = '/';
da_file_name[prefix_len++] = *separator;
}
memcpy (da_file_name + prefix_len, filename, len);
strcpy (da_file_name + prefix_len + len, GCOV_DATA_SUFFIX);
Expand Down
7 changes: 7 additions & 0 deletions include/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2020-04-17 Martin Liska <[email protected]>
Jonathan Yong <[email protected]>

PR gcov-profile/94570
* filenames.h (defined): Do not define HAVE_DOS_BASED_FILE_SYSTEM
for CYGWIN.

2020-04-01 Maciej W. Rozycki <[email protected]>

PR lto/94249
Expand Down
3 changes: 2 additions & 1 deletion include/filenames.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
extern "C" {
#endif

#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)
#if defined(__MSDOS__) || (defined(_WIN32) && ! defined(__CYGWIN__)) || \
defined(__OS2__)
# ifndef HAVE_DOS_BASED_FILE_SYSTEM
# define HAVE_DOS_BASED_FILE_SYSTEM 1
# endif
Expand Down
4 changes: 2 additions & 2 deletions ltmain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3425,8 +3425,8 @@ int setenv (const char *, const char *, int);
# define PATH_SEPARATOR ':'
#endif
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
defined (__OS2__)
#if (defined (_WIN32) && ! defined(__CYGWIN__)) || defined (__MSDOS__) || \
defined (__DJGPP__) || defined (__OS2__)
# define HAVE_DOS_BASED_FILE_SYSTEM
# define FOPEN_WB "wb"
# ifndef DIR_SEPARATOR_2
Expand Down

0 comments on commit e9f799d

Please sign in to comment.