ref: 121859ef651ca7f1e445b3a7065cd04d715c7e94
parent: e1a27c9ac1f2f44056c65f5ebc590a2cc8385d5d
author: Moriyoshi Koizumi <mozo@mozo.jp>
date: Mon Jan 16 07:25:42 EST 2017
Cygwin x86_64 support.
--- /dev/null
+++ b/build/platform-cygwin_nt.mk
@@ -1,0 +1,20 @@
+include $(SRC_PATH)build/x86-common.mk
+SHAREDLIB_DIR = $(PREFIX)/bin
+SHAREDLIBSUFFIX = dll
+SHAREDLIBSUFFIXFULLVER=$(SHAREDLIBSUFFIX)
+SHAREDLIBSUFFIXMAJORVER=$(SHAREDLIBSUFFIX)
+EXTRA_LIBRARY=$(LIBPREFIX)$(PROJECT_NAME).dll.a
+SHLDFLAGS = -Wl,--out-implib,$(EXTRA_LIBRARY)
+CFLAGS += -MMD -MP
+LDFLAGS +=
+ifeq ($(ARCH), x86_64)
+ASMFLAGS += -f win64
+ASMFLAGS_PLATFORM = -DWIN64
+CC = x86_64-pc-cygwin-gcc
+CXX = x86_64-pc-cygwin-g++
+AR = x86_64-pc-cygwin-gcc-ar
+else
+ASMFLAGS += -f win32 -DPREFIX
+endif
+EXEEXT = .exe
+
--- a/codec/common/inc/WelsThreadLib.h
+++ b/codec/common/inc/WelsThreadLib.h
@@ -47,7 +47,7 @@
extern "C" {
#endif
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>
--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -44,7 +44,7 @@
#define _GNU_SOURCE
#endif
#include <sched.h>
-#elif !defined(_WIN32)
+#elif !defined(_WIN32) && !defined(__CYGWIN__)
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/param.h>
@@ -67,7 +67,7 @@
#include <stdlib.h>
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
#ifdef WINAPI_FAMILY
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
@@ -129,7 +129,7 @@
#endif /* !_WIN32 */
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
WELS_THREAD_ERROR_CODE WelsEventOpen (WELS_EVENT* event, const char* event_name) {
WELS_EVENT h = CreateEvent (NULL, FALSE, FALSE, NULL);