fs/Charset: add macro HAVE_FS_CHARSET

This commit is contained in:
Max Kellermann 2014-11-29 23:35:49 +01:00
parent fd2c6b8a4b
commit 125daea16a
4 changed files with 7 additions and 3 deletions

View File

@ -45,7 +45,7 @@ AllocatedPath::~AllocatedPath() {}
AllocatedPath AllocatedPath
AllocatedPath::FromUTF8(const char *path_utf8) AllocatedPath::FromUTF8(const char *path_utf8)
{ {
#ifdef HAVE_GLIB #ifdef HAVE_FS_CHARSET
char *path = ::PathFromUTF8(path_utf8); char *path = ::PathFromUTF8(path_utf8);
if (path == nullptr) if (path == nullptr)
return AllocatedPath::Null(); return AllocatedPath::Null();

View File

@ -91,7 +91,7 @@ SetFSCharset(const char *charset, Error &error)
const char * const char *
GetFSCharset() GetFSCharset()
{ {
#ifdef HAVE_GLIB #ifdef HAVE_FS_CHARSET
return fs_charset.empty() ? "UTF-8" : fs_charset.c_str(); return fs_charset.empty() ? "UTF-8" : fs_charset.c_str();
#else #else
return "UTF-8"; return "UTF-8";

View File

@ -25,6 +25,10 @@
#include <string> #include <string>
#ifdef HAVE_GLIB
#define HAVE_FS_CHARSET
#endif
class Error; class Error;
/** /**

View File

@ -32,7 +32,7 @@
bool bool
ConfigureFS(Error &error) ConfigureFS(Error &error)
{ {
#ifdef HAVE_GLIB #ifdef HAVE_FS_CHARSET
const char *charset = nullptr; const char *charset = nullptr;
charset = config_get_string(CONF_FS_CHARSET, nullptr); charset = config_get_string(CONF_FS_CHARSET, nullptr);