+2019-04-26 Bruno Haible <bruno@clisp.org>
+
+ relocatable-prog: Fix gcc warning on mingw.
+ * lib/progreloc.c (maybe_executable): Don't define on native Windows and
+ on EMX.
+
2019-04-02 Bruno Haible <bruno@clisp.org>
gitsub.sh: New file.
static int executable_fd = -1;
#endif
+/* Define this function only when it's needed. */
+#if !(defined WINDOWS_NATIVE || defined __EMX__)
+
/* Tests whether a given pathname may belong to the executable. */
static bool
maybe_executable (const char *filename)
{
/* The native Windows API lacks the access() function. */
-#if !defined WINDOWS_NATIVE
+# if !defined WINDOWS_NATIVE
if (access (filename, X_OK) < 0)
return false;
-#endif
+# endif
-#if defined __linux__ || defined __CYGWIN__
+# if defined __linux__ || defined __CYGWIN__
if (executable_fd >= 0)
{
/* If we already have an executable_fd, check that filename points to
return false;
}
}
-#endif
+# endif
return true;
}
+#endif
+
/* Determine the full pathname of the current executable, freshly allocated.
Return NULL if unknown.
Guaranteed to work on Linux and native Windows. Likely to work on the