diff options
Diffstat (limited to 'include/cru/base')
-rw-r--r-- | include/cru/base/Osx.h | 9 | ||||
-rw-r--r-- | include/cru/base/String.h | 14 |
2 files changed, 7 insertions, 16 deletions
diff --git a/include/cru/base/Osx.h b/include/cru/base/Osx.h index 711da9a3..057302c2 100644 --- a/include/cru/base/Osx.h +++ b/include/cru/base/Osx.h @@ -1,9 +1,11 @@ #pragma once -#ifndef CRU_PLATFORM_OSX -#error "This header can only be included on OSX." +#ifndef __APPLE__ +#error "This header can only be included on OSX platforms." #endif +#include "String.h" + #include <CoreFoundation/CoreFoundation.h> namespace cru { @@ -23,4 +25,7 @@ class CFWrapper { return ref; } }; + +CFWrapper<CFStringRef> ToCFStringRef(StringView string); +String FromCFStringRef(CFStringRef string); } // namespace cru diff --git a/include/cru/base/String.h b/include/cru/base/String.h index 49c96c4a..21a3db51 100644 --- a/include/cru/base/String.h +++ b/include/cru/base/String.h @@ -14,11 +14,6 @@ #include <type_traits> #include <vector> -#ifdef CRU_PLATFORM_OSX -#include <CoreFoundation/CoreFoundation.h> -#include <cru/base/Osx.h> -#endif - namespace cru { class StringView; @@ -242,11 +237,6 @@ class CRU_BASE_API String { } #endif -#ifdef CRU_PLATFORM_OSX - CFWrapper<CFStringRef> ToCFStringRef() const; - static String FromCFStringRef(CFStringRef string); -#endif - template <typename... T> String Format(T&&... args) const; @@ -390,10 +380,6 @@ class CRU_BASE_API StringView { std::string ToUtf8() const; Buffer ToUtf8Buffer(bool end_zero = true) const; -#ifdef CRU_PLATFORM_OSX - CFWrapper<CFStringRef> ToCFStringRef() const; -#endif - private: const char16_t* ptr_; Index size_; |