On 5/12/23 19:20, Michal Privoznik wrote:
And I just thought of another alternative:
diff --git i/tests/virmockstathelpers.c w/tests/virmockstathelpers.c
index 5b1f3b08a7..8a76c5e369 100644
--- i/tests/virmockstathelpers.c
+++ w/tests/virmockstathelpers.c
@@ -118,20 +118,30 @@
# define MOCK_STAT
# if defined(WITH_STAT64_DECL)
# define MOCK_STAT64
# endif
# define MOCK_LSTAT
# if defined(WITH_LSTAT64_DECL)
# define MOCK_LSTAT64
# endif
#endif
+#if !defined(MOCK_STAT) && !defined(MOCK_STAT64) && \
+ !defined(MOCK___XSTAT) && !defined(MOCK___XSTAT64)
+# define MOCK_STAT
+#endif
+
+#if !defined(MOCK_LSTAT) && !defined(MOCK_LSTAT64) && \
+ !defined(MOCK___LXSTAT) && !defined(MOCK___LXSTAT64)
+# define MOCK_LSTAT
+#endif
+
#ifdef MOCK_STAT
static int (*real_stat)(const char *path, struct stat *sb);
#endif
#ifdef MOCK_STAT64
static int (*real_stat64)(const char *path, struct stat64 *sb);
#endif
#ifdef MOCK___XSTAT
static int (*real___xstat)(int ver, const char *path, struct stat *sb);
#endif
#ifdef MOCK___XSTAT64
But I can't decide which is better.
Michal