Cygwin: Fix remaining warnings building path testsuite
This commit is contained in:
parent
0d0f06416a
commit
604bb7126e
|
@ -124,7 +124,7 @@ MINGW_BINS += testsuite.exe
|
||||||
MINGW_OBJS += path-testsuite.o testsuite.o
|
MINGW_OBJS += path-testsuite.o testsuite.o
|
||||||
testsuite.exe: path-testsuite.o
|
testsuite.exe: path-testsuite.o
|
||||||
path-testsuite.cc: path.cc ; @test -L $@ || ln -sf ${filter %.cc,$^} $@
|
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
|
# this is necessary because this .c lives in the build dir instead of src
|
||||||
path-testsuite.o: MINGW_CXXFLAGS += -I$(srcdir)
|
path-testsuite.o: MINGW_CXXFLAGS += -I$(srcdir)
|
||||||
path-testsuite.cc path.cc testsuite.cc: testsuite.h
|
path-testsuite.cc path.cc testsuite.cc: testsuite.h
|
||||||
|
|
|
@ -559,6 +559,7 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end)
|
||||||
|
|
||||||
#ifndef FSTAB_ONLY
|
#ifndef FSTAB_ONLY
|
||||||
|
|
||||||
|
#ifndef TESTSUITE
|
||||||
static int
|
static int
|
||||||
mnt_sort (const void *a, const void *b)
|
mnt_sort (const void *a, const void *b)
|
||||||
{
|
{
|
||||||
|
@ -580,9 +581,6 @@ extern "C" WCHAR cygwin_dll_path[];
|
||||||
static void
|
static void
|
||||||
read_mounts ()
|
read_mounts ()
|
||||||
{
|
{
|
||||||
/* If TESTSUITE is defined, bypass this whole function as a harness
|
|
||||||
mount table will be provided. */
|
|
||||||
#ifndef TESTSUITE
|
|
||||||
HKEY setup_key;
|
HKEY setup_key;
|
||||||
LONG ret;
|
LONG ret;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
@ -654,8 +652,8 @@ read_mounts ()
|
||||||
from_fstab (false, path, path_end);
|
from_fstab (false, path, path_end);
|
||||||
from_fstab (true, path, path_end);
|
from_fstab (true, path, path_end);
|
||||||
qsort (mount_table, max_mount_entry, sizeof (mnt_t), mnt_sort);
|
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.
|
/* Return non-zero if PATH1 is a prefix of PATH2.
|
||||||
Both are assumed to be of the same path style and / vs \ usage.
|
Both are assumed to be of the same path style and / vs \ usage.
|
||||||
|
|
|
@ -15,7 +15,9 @@ details. */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#ifndef TESTSUITE
|
||||||
#define TESTSUITE
|
#define TESTSUITE
|
||||||
|
#endif
|
||||||
#include "testsuite.h"
|
#include "testsuite.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -30,12 +30,12 @@ details. */
|
||||||
#if defined(TESTSUITE_MOUNT_TABLE)
|
#if defined(TESTSUITE_MOUNT_TABLE)
|
||||||
static mnt_t mount_table[] = {
|
static mnt_t mount_table[] = {
|
||||||
/* native posix flags */
|
/* native posix flags */
|
||||||
{ TESTSUITE_ROOT, (char*)"/", MOUNT_SYSTEM},
|
{ (char*)TESTSUITE_ROOT, (char*)"/", MOUNT_SYSTEM},
|
||||||
{ "O:\\other", (char*)"/otherdir", MOUNT_SYSTEM},
|
{ (char*)"O:\\other", (char*)"/otherdir", MOUNT_SYSTEM},
|
||||||
{ "S:\\some\\dir", (char*)"/somedir", MOUNT_SYSTEM},
|
{ (char*)"S:\\some\\dir", (char*)"/somedir", MOUNT_SYSTEM},
|
||||||
{ TESTSUITE_ROOT"\\bin", (char*)"/usr/bin", MOUNT_SYSTEM},
|
{ (char*)TESTSUITE_ROOT"\\bin", (char*)"/usr/bin", MOUNT_SYSTEM},
|
||||||
{ TESTSUITE_ROOT"\\lib", (char*)"/usr/lib", MOUNT_SYSTEM},
|
{ (char*)TESTSUITE_ROOT"\\lib", (char*)"/usr/lib", MOUNT_SYSTEM},
|
||||||
{ ".", (char*)TESTSUITE_CYGDRIVE, MOUNT_SYSTEM | MOUNT_CYGDRIVE},
|
{ (char*)".", (char*)TESTSUITE_CYGDRIVE, MOUNT_SYSTEM | MOUNT_CYGDRIVE},
|
||||||
{ NULL, (char*)NULL, 0}
|
{ NULL, (char*)NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue