Cygwin: Fix remaining warnings building path testsuite

This commit is contained in:
Corinna Vinschen 2020-12-01 10:10:40 +01:00 committed by Jon Turney
parent 0d0f06416a
commit 604bb7126e
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
4 changed files with 11 additions and 11 deletions

View File

@ -124,7 +124,7 @@ MINGW_BINS += testsuite.exe
MINGW_OBJS += path-testsuite.o testsuite.o
testsuite.exe: path-testsuite.o
path-testsuite.cc: path.cc ; @test -L $@ || ln -sf ${filter %.cc,$^} $@
path-testsuite.o: MINGW_CXXFLAGS += -DTESTSUITE -Wno-error=write-strings
path-testsuite.o: MINGW_CXXFLAGS += -DTESTSUITE
# this is necessary because this .c lives in the build dir instead of src
path-testsuite.o: MINGW_CXXFLAGS += -I$(srcdir)
path-testsuite.cc path.cc testsuite.cc: testsuite.h

View File

@ -559,6 +559,7 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end)
#ifndef FSTAB_ONLY
#ifndef TESTSUITE
static int
mnt_sort (const void *a, const void *b)
{
@ -580,9 +581,6 @@ extern "C" WCHAR cygwin_dll_path[];
static void
read_mounts ()
{
/* If TESTSUITE is defined, bypass this whole function as a harness
mount table will be provided. */
#ifndef TESTSUITE
HKEY setup_key;
LONG ret;
DWORD len;
@ -654,8 +652,8 @@ read_mounts ()
from_fstab (false, path, path_end);
from_fstab (true, path, path_end);
qsort (mount_table, max_mount_entry, sizeof (mnt_t), mnt_sort);
#endif /* !defined(TESTSUITE) */
}
#endif /* !defined(TESTSUITE) */
/* Return non-zero if PATH1 is a prefix of PATH2.
Both are assumed to be of the same path style and / vs \ usage.

View File

@ -15,7 +15,9 @@ details. */
#include <unistd.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifndef TESTSUITE
#define TESTSUITE
#endif
#include "testsuite.h"
typedef struct

View File

@ -30,12 +30,12 @@ details. */
#if defined(TESTSUITE_MOUNT_TABLE)
static mnt_t mount_table[] = {
/* native posix flags */
{ TESTSUITE_ROOT, (char*)"/", MOUNT_SYSTEM},
{ "O:\\other", (char*)"/otherdir", MOUNT_SYSTEM},
{ "S:\\some\\dir", (char*)"/somedir", MOUNT_SYSTEM},
{ TESTSUITE_ROOT"\\bin", (char*)"/usr/bin", MOUNT_SYSTEM},
{ TESTSUITE_ROOT"\\lib", (char*)"/usr/lib", MOUNT_SYSTEM},
{ ".", (char*)TESTSUITE_CYGDRIVE, MOUNT_SYSTEM | MOUNT_CYGDRIVE},
{ (char*)TESTSUITE_ROOT, (char*)"/", MOUNT_SYSTEM},
{ (char*)"O:\\other", (char*)"/otherdir", MOUNT_SYSTEM},
{ (char*)"S:\\some\\dir", (char*)"/somedir", MOUNT_SYSTEM},
{ (char*)TESTSUITE_ROOT"\\bin", (char*)"/usr/bin", MOUNT_SYSTEM},
{ (char*)TESTSUITE_ROOT"\\lib", (char*)"/usr/lib", MOUNT_SYSTEM},
{ (char*)".", (char*)TESTSUITE_CYGDRIVE, MOUNT_SYSTEM | MOUNT_CYGDRIVE},
{ NULL, (char*)NULL, 0}
};