#include <assert.h>
#include <cstring>
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
// On linux the runtime uses 16 bit strings but the native platform wchar_t is 32 bit.
// This means there aren't c runtime functions like wcslen for 16 bit strings. The idea
// here is to provide the easy ones to avoid all the copying and transforming. If more complex
return lhs[i] - rhs[i];
}
-#else // defined(__linux__) || defined(__APPLE__)
+#else // defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#define WCHAR(str) L##str
-#endif // defined(__linux__) || defined(__APPLE__)
+#endif // defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
// 16 bit string type that works cross plat and doesn't require changing widths
// on non-windows platforms
break;
}
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
os << static_cast<wchar_t>(obj.buffer[i]);
-#else // defined(__linux__) || defined(__APPLE__)
+#else // defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
os << obj.buffer[i];
-#endif // defined(__linux__) || defined(__APPLE__)
+#endif // defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
}
return os;
-}
\ No newline at end of file
+}