aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-01-08 13:29:07 +0200
committerMartin Storsjö <martin@martin.st>2020-01-08 13:53:31 +0200
commit2dc2b11fba675015a997be1e5ec1df897a0fff26 (patch)
treea070880d721de63f95458aea6cb830b3ebf68eb4
parent5bd001043d91077eabd4cd1ffa71b396cf07c04d (diff)
downloadffmpeg-2dc2b11fba675015a997be1e5ec1df897a0fff26.tar.gz
cmdutils: Fix compilation on cygwin wrt SetDllDirectory and GetModuleHandle
After 06ec9c4746ebc1d3b613c1847e434bbd0b4407b4 we check for these functions in configure (which will succeed in cygwin), but cmdutils.c only includes windows.h if _WIN32 is defined (which it isn't in cygwin). Retain the old intent from before 06ec9c4746ebc1d3b613c1847e434bbd0b4407b4, that these functions only would be used when _WIN32 is defined, while only using them if configure has agreed that they do exist. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--fftools/cmdutils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index e4f4861d66..7954f23430 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -119,7 +119,7 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
void init_dynload(void)
{
-#if HAVE_SETDLLDIRECTORY
+#if HAVE_SETDLLDIRECTORY && defined(_WIN32)
/* Calling SetDllDirectory with the empty string (but not NULL) removes the
* current working directory from the DLL search path as a security pre-caution. */
SetDllDirectory("");
@@ -2039,7 +2039,7 @@ FILE *get_preset_file(char *filename, size_t filename_size,
av_strlcpy(filename, preset_name, filename_size);
f = fopen(filename, "r");
} else {
-#if HAVE_GETMODULEHANDLE
+#if HAVE_GETMODULEHANDLE && defined(_WIN32)
char datadir[MAX_PATH], *ls;
base[2] = NULL;