tests: stub out virfilewrapper.c on Win32

The Win32 platform can not do link time overrides in the same way
that we can on POSIX / ELF based platforms, so we cannot build
the virfilewrapper.c code reliably. Just stub it out on Win32
so it is a no-op. Tests that use this file are already written
to skip on Win32.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2017-05-11 11:42:14 +01:00
parent bf12395230
commit 300c7c7035

View File

@ -18,15 +18,17 @@
#include <config.h> #include <config.h>
#include <stdio.h> #ifndef WIN32
#include <stdlib.h>
#include <fcntl.h>
#include "viralloc.h" # include <stdio.h>
#include "virfile.h" # include <stdlib.h>
#include "virfilewrapper.h" # include <fcntl.h>
#include "virmock.h"
#include "virstring.h" # include "viralloc.h"
# include "virfile.h"
# include "virfilewrapper.h"
# include "virmock.h"
# include "virstring.h"
/* Mapping for prefix overrides */ /* Mapping for prefix overrides */
@ -139,7 +141,7 @@ virFileWrapperOverridePrefix(const char *path)
} }
#define PATH_OVERRIDE(newpath, path) \ # define PATH_OVERRIDE(newpath, path) \
do { \ do { \
init_syms(); \ init_syms(); \
\ \
@ -177,7 +179,7 @@ int access(const char *path, int mode)
return ret; return ret;
} }
#ifdef HAVE___LXSTAT # ifdef HAVE___LXSTAT
int __lxstat(int ver, const char *path, struct stat *sb) int __lxstat(int ver, const char *path, struct stat *sb)
{ {
int ret = -1; int ret = -1;
@ -191,7 +193,7 @@ int __lxstat(int ver, const char *path, struct stat *sb)
return ret; return ret;
} }
#endif /* HAVE___LXSTAT */ # endif /* HAVE___LXSTAT */
int lstat(const char *path, struct stat *sb) int lstat(const char *path, struct stat *sb)
{ {
@ -207,7 +209,7 @@ int lstat(const char *path, struct stat *sb)
return ret; return ret;
} }
#ifdef HAVE___XSTAT # ifdef HAVE___XSTAT
int __xstat(int ver, const char *path, struct stat *sb) int __xstat(int ver, const char *path, struct stat *sb)
{ {
int ret = -1; int ret = -1;
@ -221,7 +223,7 @@ int __xstat(int ver, const char *path, struct stat *sb)
return ret; return ret;
} }
#endif /* HAVE___XSTAT */ # endif /* HAVE___XSTAT */
int stat(const char *path, struct stat *sb) int stat(const char *path, struct stat *sb)
{ {
@ -278,3 +280,4 @@ DIR *opendir(const char *path)
return ret; return ret;
} }
#endif