build: Replace MAC_OSX macro with existing __APPLE__

Adopting `__APPLE__` aligns our project with broader industry practices, including those in prominent projects such as the Linux kernel (and even our own code).

See: https://sourceforge.net/p/predef/wiki/OperatingSystems/#macos
This commit is contained in:
Lőrinc
2024-02-19 13:43:49 +01:00
parent d94adc7270
commit 6c6b2442ed
6 changed files with 9 additions and 12 deletions

View File

@@ -117,7 +117,7 @@ bool FileCommit(FILE* file)
LogPrintf("FlushFileBuffers failed: %s\n", Win32ErrorString(GetLastError()));
return false;
}
#elif defined(MAC_OSX) && defined(F_FULLFSYNC)
#elif defined(__APPLE__) && defined(F_FULLFSYNC)
if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { // Manpage says "value other than -1" is returned on success
LogPrintf("fcntl F_FULLFSYNC failed: %s\n", SysErrorString(errno));
return false;
@@ -195,7 +195,7 @@ void AllocateFileRange(FILE* file, unsigned int offset, unsigned int length)
nFileSize.u.HighPart = nEndPos >> 32;
SetFilePointerEx(hFile, nFileSize, 0, FILE_BEGIN);
SetEndOfFile(hFile);
#elif defined(MAC_OSX)
#elif defined(__APPLE__)
// OSX specific version
// NOTE: Contrary to other OS versions, the OSX version assumes that
// NOTE: offset is the size of the file.

View File

@@ -29,7 +29,7 @@ static void SetThreadName(const char* name)
::prctl(PR_SET_NAME, name, 0, 0, 0);
#elif (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
pthread_set_name_np(pthread_self(), name);
#elif defined(MAC_OSX)
#elif defined(__APPLE__)
pthread_setname_np(name);
#else
// Prevent warnings for unused parameters...