Use built-in __APPLE__ macro instead of SYS_DARWIN and MACOSX

This commit is contained in:
Mitchell Livingston 2014-07-03 19:20:12 +00:00
parent 7ddaf60cb6
commit 084273c106
9 changed files with 17 additions and 43 deletions

View File

@ -3207,7 +3207,6 @@
);
OTHER_CFLAGS = (
"$(inherited)",
"-DSYS_DARWIN",
"-DWITH_UTP",
"-DHAVE_OPENSSL",
"-D__TRANSMISSION__",
@ -3232,10 +3231,6 @@
"$(inherited)",
"\"$(SRCROOT)/third-party/curl/lib\"",
);
OTHER_CFLAGS = (
"$(inherited)",
"-DSYS_DARWIN",
);
PRODUCT_NAME = Transmission;
WRAPPER_EXTENSION = app;
};
@ -3295,7 +3290,6 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
MACOSX,
BUILD_MAC_CLIENT,
XCODE_BUILD,
);
@ -3359,7 +3353,6 @@
);
OTHER_CFLAGS = (
"$(inherited)",
"-DSYS_DARWIN",
"-DWITH_UTP",
"-DHAVE_OPENSSL",
"-D__TRANSMISSION__",
@ -3394,10 +3387,6 @@
"$(inherited)",
"\"$(SRCROOT)/third-party/curl/lib\"",
);
OTHER_CFLAGS = (
"$(inherited)",
"-DSYS_DARWIN",
);
PRODUCT_NAME = Transmission;
WRAPPER_EXTENSION = app;
};
@ -3417,7 +3406,6 @@
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
MACOSX,
NS_BLOCK_ASSERTIONS,
BUILD_MAC_CLIENT,
XCODE_BUILD,
@ -3478,7 +3466,6 @@
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
MACOSX,
BUILD_MAC_CLIENT,
XCODE_BUILD,
);
@ -3511,10 +3498,6 @@
"$(inherited)",
"\"$(SRCROOT)/third-party/curl/lib\"",
);
OTHER_CFLAGS = (
"$(inherited)",
"-DSYS_DARWIN",
);
PRODUCT_NAME = Transmission;
WRAPPER_EXTENSION = app;
};
@ -3546,7 +3529,6 @@
);
OTHER_CFLAGS = (
"$(inherited)",
"-DSYS_DARWIN",
"-DWITH_UTP",
"-DHAVE_OPENSSL",
"-D__TRANSMISSION__",
@ -3603,7 +3585,6 @@
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = (
POSIX,
MACOSX,
);
PRODUCT_NAME = utp;
};
@ -3614,7 +3595,6 @@
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = (
POSIX,
MACOSX,
);
PRODUCT_NAME = utp;
};
@ -3625,7 +3605,6 @@
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = (
POSIX,
MACOSX,
NS_BLOCK_ASSERTIONS,
);
PRODUCT_NAME = utp;

View File

@ -461,7 +461,6 @@ case $host_os in
*darwin*)
have_darwin="yes"
CFLAGS="-DMACOSX $CFLAGS"
;;
esac
@ -509,10 +508,6 @@ EOF
exit 1
fi
fi
if test "x$have_darwin" = "xyes"; then
AC_DEFINE([HAVE_DARWIN], 1)
AC_DEFINE([SYS_DARWIN], 1)
fi
if test "x$have_msw" = "xyes"; then
AC_DEFINE([HAVE_MSW], 1)
fi

View File

@ -18,7 +18,7 @@
#include <errno.h>
#include <inttypes.h>
#include <string.h>
#ifdef SYS_DARWIN
#ifdef __APPLE__
#include <fcntl.h>
#endif
@ -129,7 +129,7 @@ preallocate_file_full (const char * filename, uint64_t length)
success = !xfsctl (NULL, fd, XFS_IOC_RESVSP64, &fl);
}
# endif
# ifdef SYS_DARWIN
# ifdef __APPLE__
if (!success)
{
fstore_t fst;
@ -197,7 +197,7 @@ tr_fsync (int fd)
#endif
#endif
#ifdef SYS_DARWIN
#ifdef __APPLE__
#define HAVE_PREAD
#define HAVE_PWRITE
#endif
@ -233,7 +233,7 @@ tr_prefetch (int fd UNUSED, off_t offset UNUSED, size_t count UNUSED)
{
#ifdef HAVE_POSIX_FADVISE
return posix_fadvise (fd, offset, count, POSIX_FADV_WILLNEED);
#elif defined (SYS_DARWIN)
#elif defined (__APPLE__)
struct radvisory radv;
radv.ra_offset = offset;
radv.ra_count = count;
@ -254,7 +254,7 @@ tr_set_file_for_single_pass (int fd)
#ifdef HAVE_POSIX_FADVISE
posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
#ifdef SYS_DARWIN
#ifdef __APPLE__
fcntl (fd, F_RDAHEAD, 1);
fcntl (fd, F_NOCACHE, 1);
#endif
@ -584,7 +584,7 @@ tr_fdFileGetCached (tr_session * s, int torrent_id, tr_file_index_t i, bool writ
return o->fd;
}
#ifdef SYS_DARWIN
#ifdef __APPLE__
#define TR_STAT_MTIME(sb)((sb).st_mtimespec.tv_sec)
#else
#define TR_STAT_MTIME(sb)((sb).st_mtime)

View File

@ -47,7 +47,7 @@
#endif
#endif
#ifdef SYS_DARWIN
#ifdef __APPLE__
#define HAVE_SYS_STATVFS_H
#define HAVE_STATVFS
#endif
@ -246,7 +246,7 @@ getquota (const char * device)
int64_t freespace;
int64_t spaceused;
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(SYS_DARWIN)
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
if (quotactl(device, QCMD(Q_GETQUOTA, USRQUOTA), getuid(), (caddr_t) &dq) == 0)
{
#elif defined(__sun)
@ -280,7 +280,7 @@ getquota (const char * device)
}
#if defined(__FreeBSD__) || defined(__OpenBSD__)
spaceused = (int64_t) dq.dqb_curblocks >> 1;
#elif defined(SYS_DARWIN)
#elif defined(__APPLE__)
spaceused = (int64_t) dq.dqb_curbytes;
#elif defined(__UCLIBC__)
spaceused = (int64_t) btodb(dq.dqb_curblocks);
@ -290,7 +290,7 @@ getquota (const char * device)
spaceused = btodb(dq.dqb_curspace);
#endif
freespace = limit - spaceused;
#ifdef SYS_DARWIN
#ifdef __APPLE__
return (freespace < 0) ? 0 : freespace;
#else
return (freespace < 0) ? 0 : freespace * 1024;

View File

@ -254,7 +254,7 @@ getHomeDir (void)
return home;
}
#if defined (SYS_DARWIN) || defined (WIN32)
#if defined (__APPLE__) || defined (WIN32)
#define RESUME_SUBDIR "Resume"
#define TORRENT_SUBDIR "Torrents"
#else
@ -312,7 +312,7 @@ tr_getDefaultConfigDir (const char * appname)
}
else
{
#ifdef SYS_DARWIN
#ifdef __APPLE__
s = tr_buildPath (getHomeDir (), "Library", "Application Support", appname, NULL);
#elif defined (WIN32)
char appdata[TR_PATH_MAX]; /* SHGetFolderPath () requires MAX_PATH */

View File

@ -2827,7 +2827,7 @@ isJunkFile (const char * base)
if (!strcmp (base, files[i]))
return true;
#ifdef SYS_DARWIN
#ifdef __APPLE__
/* check for resource forks. <http://support.apple.com/kb/TA20578> */
if (!memcmp (base, "._", 2))
return true;

View File

@ -494,7 +494,7 @@ tr_buildPath (const char *first_element, ...)
return buf;
}
#ifdef SYS_DARWIN
#ifdef __APPLE__
#define TR_STAT_MTIME(sb)((sb).st_mtimespec.tv_sec)
#else
#define TR_STAT_MTIME(sb)((sb).st_mtime)

View File

@ -77,7 +77,7 @@ extern "C" {
const char * tr_strip_positional_args (const char * fmt);
#if !defined (_)
#if defined (HAVE_LIBINTL_H) && !defined (SYS_DARWIN)
#if defined (HAVE_LIBINTL_H) && !defined (__APPLE__)
#include <libintl.h>
#define _(a) gettext (a)
#else

View File

@ -6,7 +6,7 @@
* This software is subjet to the conditions detailed in the
* provided LICENSE file. */
#define __EXTENSIONS__ 1
#if !defined(MACOSX) && !defined(__sun)
#if !defined(__APPLE__) && !defined(__sun)
#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__)
#ifndef __cplusplus
#define _XOPEN_SOURCE 600
@ -17,7 +17,7 @@
#endif
#endif
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(MACOSX) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun)
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun)
#define HAS_IP_MREQN
#endif