Index: src/OFLocalization.h ================================================================== --- src/OFLocalization.h +++ src/OFLocalization.h @@ -120,16 +120,18 @@ * * @return The decimal point of the system's locale */ + (OFString*)decimalPoint; +#ifdef OF_HAVE_FILES /*! * @brief Adds a directory to scan for language files. * * @param path The path to the directory to scan for language files */ + (void)addLanguageDirectory: (OFString*)path; +#endif /*! * @brief Initializes the OFLocalization singleton with the specified locale. * * @warning You should never call this yourself, except if you do not use @@ -139,16 +141,18 @@ * * @param locale The locale used, as returned from `setlocale()` */ - initWithLocale: (char*)locale; +#ifdef OF_HAVE_FILES /*! * @brief Adds a directory to scan for language files. * * @param path The path to the directory to scan for language files */ - (void)addLanguageDirectory: (OFString*)path; +#endif /*! * @brief Returns the localized string for the specified ID, using the fallback * string if it cannot be looked up or is missing. * Index: src/OFLocalization.m ================================================================== --- src/OFLocalization.m +++ src/OFLocalization.m @@ -55,14 +55,16 @@ + (OFString*)decimalPoint { return [sharedLocalization decimalPoint]; } +#ifdef OF_HAVE_FILES + (void)addLanguageDirectory: (OFString*)path { [sharedLocalization addLanguageDirectory: path]; } +#endif - initWithLocale: (char*)locale { self = [super init]; @@ -142,10 +144,11 @@ [_localizedStrings release]; [super dealloc]; } +#ifdef OF_HAVE_FILES - (void)addLanguageDirectory: (OFString*)path { void *pool; OFString *mapPath, *language, *territory, *languageFile; OFDictionary *map; @@ -180,10 +183,11 @@ [_localizedStrings addObject: [[OFString stringWithContentsOfFile: languageFile] JSONValue]]; objc_autoreleasePoolPop(pool); } +#endif - (OFString*)localizedStringForID: (OFConstantString*)ID fallback: (OFConstantString*)fallback, ... { OFString *ret; Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -976,11 +976,11 @@ - initWithContentsOfURL: (OFURL*)URL encoding: (of_string_encoding_t)encoding { void *pool; OFString *scheme; -# if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) +# ifdef OF_HAVE_FILES Class c = [self class]; # endif [self release]; Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -12,11 +12,10 @@ OFArrayTests.m \ ${OFBLOCKTESTS_M} \ OFDataArrayTests.m \ OFDateTests.m \ OFDictionaryTests.m \ - OFHMACTests.m \ OFJSONTests.m \ OFListTests.m \ OFNumberTests.m \ OFObjectTests.m \ OFSetTests.m \ @@ -33,11 +32,12 @@ ${USE_SRCS_FILES} \ ${USE_SRCS_PLUGINS} \ ${USE_SRCS_SOCKETS} \ ${USE_SRCS_THREADS} \ ${OFHTTPCLIENTTESTS_M} -SRCS_FILES = OFINIFileTests.m \ +SRCS_FILES = OFHMACTests.m \ + OFINIFileTests.m \ OFMD5HashTests.m \ OFRIPEMD160HashTests.m \ OFSerializationTests.m \ OFSHA1HashTests.m \ OFSHA224HashTests.m \