Windows: replace __CYGWIN__ with __MSYS__

This commit is contained in:
李通洲
2022-10-08 16:07:59 +08:00
parent 09a2f96cf0
commit 89850535ae
7 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -259,7 +259,7 @@ void ffInitInstance(FFinstance* instance)
defaultConfig(instance);
}
#if !defined(__ANDROID__) && !defined(__CYGWIN__)
#if !defined(__ANDROID__) && !defined(_WIN32) && !defined(__MSYS__)
static void* connectDisplayServerThreadMain(void* instance)
{
+3 -3
View File
@@ -4,7 +4,7 @@
#define FF_INCLUDED_common_time
#include <stdint.h>
#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__MSYS__)
#include <synchapi.h>
#include <sysinfoapi.h>
#else
@@ -14,7 +14,7 @@
static inline uint64_t ffTimeGetTick() //In msec
{
#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__MSYS__)
return GetTickCount64();
#else
struct timeval timeNow;
@@ -25,7 +25,7 @@ static inline uint64_t ffTimeGetTick() //In msec
static inline void ffTimeSleep(uint32_t msec)
{
#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__MSYS__)
SleepEx(msec, TRUE);
#else
nanosleep(&(struct timespec){ msec / 1000, (msec % 1000) * 1000000 }, NULL);
+1 -1
View File
@@ -3,7 +3,7 @@
#ifndef FF_INCLUDED_detection_cpu_cpuUsage
#define FF_INCLUDED_detection_cpu_cpuUsage
#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__MSYS__)
#define FF_DETECTION_CPUUSAGE_NOWAIT 1
#endif
+2 -2
View File
@@ -51,7 +51,7 @@ void ffDetectOSImpl(FFOSResult* os, const FFinstance* instance)
ffStrbufClear(&os->variant);
}
#ifdef __CYGWIN__
#ifdef __MSYS__
ffStrbufAppendS(&os->id, "MSYS2");
#else
// Enable this after we have Windows logo support
@@ -61,7 +61,7 @@ void ffDetectOSImpl(FFOSResult* os, const FFinstance* instance)
ffGetWmiObjString(pclsObj, L"BuildNumber", &os->buildID);
ffGetWmiObjString(pclsObj, L"OSArchitecture", &os->architecture);
#ifdef __CYGWIN__
#ifdef __MSYS__
ffStrbufSetS(&os->systemName, instance->state.utsname.sysname);
#else
ffStrbufSetS(&os->systemName, "Windows");
@@ -264,7 +264,7 @@ static void getShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* versio
}
const FFTerminalShellResult*
#if defined(__CYGWIN__) || defined(_WIN32)
#if defined(__MSYS__) || defined(_WIN32)
ffDetectTerminalShellPosix
#else
ffDetectTerminalShell
@@ -99,14 +99,14 @@ static uint32_t getTerminalInfo(FFTerminalShellResult* result, uint32_t pid)
return ppid;
}
#ifdef __CYGWIN__
#ifdef __MSYS__
extern "C"
const FFTerminalShellResult* ffDetectTerminalShellPosix(const FFinstance* instance);
#endif
const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance)
{
#ifdef __CYGWIN__
#ifdef __MSYS__
// This is hacky.
// When running inside MSYS2, the real Windows parent process doesn't exist and we must find it in Linux way ( /proc/self/xxx )
// When running outside of MSYS2, /proc/self/xxx doesn't exist and we must find it in Windows way
+1 -1
View File
@@ -40,7 +40,7 @@ static void printFont(const FFFontResult* font)
printf("%s [User]", font->fonts[1].chars);
}
#elif defined(_WIN32) || defined(__CYGWIN__)
#elif defined(_WIN32) || defined(__MSYS__)
static void printFont(const FFFontResult* font)
{