CXXFLAGS="${CXXFLAGS} -Wall"
CFLAGS="${CFLAGS} -Wstrict-prototypes -Wall"
fi
- __COMMONFLAGS="-g -O0 -Wextra -Wunused-value -Wunused-variable -Wunused-function -Wunused-label -Wcomment -Wmissing-braces -Wparentheses -Wreturn-type -Wswitch -Wstrict-aliasing -Wno-unused-parameter -Wformat -Wformat-security"
+ __COMMONFLAGS="-g -O0 -Wextra -Wunused-value -Wunused-variable -Wunused-function -Wunused-label -Wcomment -Wmissing-braces -Wparentheses -Wreturn-type -Wswitch -Wstrict-aliasing -Wno-unused-parameter -Wformat -Wformat-security -DGQ_DEBUG_PATH_UTF8=1"
CXXFLAGS="${CXXFLAGS} ${__COMMONFLAGS}"
CFLAGS="${CFLAGS} ${__COMMONFLAGS} -Wimplicit-int -Werror-implicit-function-declaration"
__IS_DEBUG_FLAGS=yes
g_string_free(string, TRUE);
}
+#if GQ_DEBUG_PATH_UTF8
+gchar *path_to_utf8_debug(const gchar *path, const gchar *file, gint line)
+#else
gchar *path_to_utf8(const gchar *path)
+#endif
{
gchar *utf8;
GError *error = NULL;
utf8 = g_filename_to_utf8(path, -1, NULL, NULL, &error);
if (error)
{
+#if GQ_DEBUG_PATH_UTF8
+ log_printf("%s:%d: Unable to convert filename to UTF-8:\n%s\n%s\n", file, line, path, error->message);
+#else
log_printf("Unable to convert filename to UTF-8:\n%s\n%s\n", path, error->message);
+#endif
g_error_free(error);
encoding_dialog(path);
}
return utf8;
}
+#if GQ_DEBUG_PATH_UTF8
+gchar *path_from_utf8_debug(const gchar *utf8, const gchar *file, gint line)
+#else
gchar *path_from_utf8(const gchar *utf8)
+#endif
{
gchar *path;
GError *error = NULL;
path = g_filename_from_utf8(utf8, -1, NULL, NULL, &error);
if (error)
{
+#if GQ_DEBUG_PATH_UTF8
+ log_printf("%s:%d: Unable to convert filename to locale from UTF-8:\n%s\n%s\n", file, line, utf8, error->message);
+#else
log_printf("Unable to convert filename to locale from UTF-8:\n%s\n%s\n", utf8, error->message);
+#endif
g_error_free(error);
}
if (!path)
g_free(msg); \
} while (0)
+#if GQ_DEBUG_PATH_UTF8
+#define path_to_utf8(path) path_to_utf8_debug(path, __FILE__, __LINE__)
+#define path_from_utf8(utf8) path_from_utf8_debug(utf8, __FILE__, __LINE__)
+gchar *path_to_utf8_debug(const gchar *path, const gchar *file, gint line);
+gchar *path_from_utf8_debug(const gchar *utf8, const gchar *file, gint line);
+#else
gchar *path_to_utf8(const gchar *path);
-gchar *path_from_utf8(const gchar *path);
+gchar *path_from_utf8(const gchar *utf8);
+#endif
const gchar *xdg_data_home_get(void);
const gchar *xdg_config_home_get(void);