avcodec/nvenc: fix library names on cygwin
authorTimo Rothenpieler <timo@rothenpieler.org>
Sun, 28 Aug 2016 15:54:29 +0000 (17:54 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Sun, 28 Aug 2016 16:58:05 +0000 (18:58 +0200)
libavcodec/nvenc.c

index d1c7d93..c92df53 100644 (file)
 
 #include "config.h"
 
-#if defined(_WIN32)
-#include <windows.h>
-
-#define CUDA_LIBNAME TEXT("nvcuda.dll")
-#if ARCH_X86_64
-#define NVENC_LIBNAME TEXT("nvEncodeAPI64.dll")
+#if defined(_WIN32) || defined(__CYGWIN__)
+# define CUDA_LIBNAME "nvcuda.dll"
+# if ARCH_X86_64
+#  define NVENC_LIBNAME "nvEncodeAPI64.dll"
+# else
+#  define NVENC_LIBNAME "nvEncodeAPI.dll"
+# endif
 #else
-#define NVENC_LIBNAME TEXT("nvEncodeAPI.dll")
+# define CUDA_LIBNAME "libcuda.so"
+# define NVENC_LIBNAME "libnvidia-encode.so"
 #endif
 
-#define dlopen(filename, flags) LoadLibrary((filename))
+#if defined(_WIN32)
+#include <windows.h>
+
+#define dlopen(filename, flags) LoadLibrary(TEXT(filename))
 #define dlsym(handle, symbol)   GetProcAddress(handle, symbol)
 #define dlclose(handle)         FreeLibrary(handle)
 #else
 #include <dlfcn.h>
-
-#define CUDA_LIBNAME "libcuda.so"
-#define NVENC_LIBNAME "libnvidia-encode.so"
 #endif
 
 #include "libavutil/hwcontext.h"