summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2017-02-11 08:27:00 +0000
committerReuben Thomas <rrt@sc3d.org>2017-02-18 18:33:07 +0000
commitab8cb763aed639667bc627adc420ba3624be7862 (patch)
treeee1ec5ae467a4f93cd9a1f29e667d35f820394cb
parent4481526d08e7e436cabc01bfa852e873fd2d2b44 (diff)
downloadenchant-ab8cb763aed639667bc627adc420ba3624be7862.tar.gz
Use standard macros to detect macOS
-rw-r--r--configure.ac2
-rw-r--r--src/enchant.c2
-rw-r--r--unittests/EnchantTestFixture.h11
-rw-r--r--unittests/broker/enchant_broker_request_pwl_dict_tests.cpp6
4 files changed, 8 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index daa51d6..93d1357 100644
--- a/configure.ac
+++ b/configure.ac
@@ -507,7 +507,7 @@ if test "x$check_applespell" = "xyes"; then
AC_ARG_ENABLE(applespell, AS_HELP_STRING([--disable-applespell],[enable the applespell backend @<:@default=no@:>@]), build_applespell="$enableval", build_applespell=no)
if test "x$build_applespell" != "xno"; then
- APPLESPELL_CFLAGS+=" -DXP_TARGET_COCOA -xobjective-c"
+ APPLESPELL_CFLAGS+=" -xobjective-c"
APPLESPELL_LIBS+=" -lobjc"
APPLESPELL_LDFLAGS+=" -framework Cocoa"
fi
diff --git a/src/enchant.c b/src/enchant.c
index b262bca..164e60a 100644
--- a/src/enchant.c
+++ b/src/enchant.c
@@ -42,7 +42,7 @@
#include "enchant-provider.h"
#include "pwl.h"
-#ifdef XP_TARGET_COCOA
+#if defined(__APPLE__) && defined(__MACH__)
#define ENCHANT_USER_PATH_EXTENSION "Library", "Application Support", "Enchant"
#elif defined(_WIN32)
#define ENCHANT_USER_PATH_EXTENSION "enchant"
diff --git a/unittests/EnchantTestFixture.h b/unittests/EnchantTestFixture.h
index 38e8a13..4725ef1 100644
--- a/unittests/EnchantTestFixture.h
+++ b/unittests/EnchantTestFixture.h
@@ -226,21 +226,18 @@ struct EnchantTestFixture
static std::string GetEnchantHomeDirFromBase(const std::string& basePath)
{
-#ifdef XP_TARGET_COCOA
- return AddToPath(AddToPath(AddToPath(basePath,"Library"),
- "Application Support"),
- "Enchant");
-#else
return AddToPath(basePath, "enchant");
-#endif
}
static std::string GetEnchantHomeDirFromHome(const std::string& homePath)
{
-#ifdef XP_TARGET_COCOA
+ // FIXME: Integrate with ENCHANT_USER_PATH_EXTENSION in enchant.c
+#if defined(__APPLE__) && defined(__MACH__)
return AddToPath(AddToPath(AddToPath(homePath,"Library"),
"Application Support"),
"Enchant");
+#elif defined(_WIN32)
+ return AddToPath(homePath, "enchant");
#else
return AddToPath(homePath, ".enchant");
#endif
diff --git a/unittests/broker/enchant_broker_request_pwl_dict_tests.cpp b/unittests/broker/enchant_broker_request_pwl_dict_tests.cpp
index 2502a82..f2abab6 100644
--- a/unittests/broker/enchant_broker_request_pwl_dict_tests.cpp
+++ b/unittests/broker/enchant_broker_request_pwl_dict_tests.cpp
@@ -117,18 +117,16 @@ TEST_FIXTURE(EnchantBrokerRequestPwlDictionary_TestFixture,
CHECK_EQUAL((void*)NULL, _dict);
}
+#if defined(_WIN32)
+// Colon is illegal for Windows but okay for Linux and macOS;
TEST_FIXTURE(EnchantBrokerRequestPwlDictionary_TestFixture,
EnchantBrokerRequestPwlDictionary_IllegalFilename_NULL)
{
- // Colon is illegal for Windows and Mac but okay for Linux;
-#if defined(XP_TARGET_COCOA) || defined(_WIN32)
_dict = enchant_broker_request_pwl_dict(_broker, ":");
CHECK(!_dict);
CHECK((void*)enchant_broker_get_error(_broker));
-#endif
}
-#if defined(_WIN32)
TEST_FIXTURE(EnchantBrokerRequestPwlDictionary_TestFixture,
EnchantBrokerRequestPwlDictionary_IllegalUtf8InFilename_NULL)
{