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::FromUTF8(const char *path_utf8)
{
#ifdef HAVE_GLIB
#ifdef HAVE_FS_CHARSET
char *path = ::PathFromUTF8(path_utf8);
if (path == nullptr)
return AllocatedPath::Null();

View File

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

View File

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

View File

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