glib_compat: lift string functions from glib. remove unused API g_win32_error_message()

This commit is contained in:
Nguyen Anh Quynh
2016-12-26 22:36:47 +08:00
parent c5b8fbfbc6
commit 520f335a2a
4 changed files with 97 additions and 121 deletions

View File

@@ -45,6 +45,7 @@ typedef unsigned int guint;
typedef char gchar;
typedef int gboolean;
typedef unsigned long gulong;
typedef unsigned long gsize;
typedef gint (*GCompareDataFunc)(gconstpointer a,
gconstpointer b,
@@ -121,16 +122,14 @@ gpointer g_memdup(gconstpointer mem, size_t byte_size);
gpointer g_new_(size_t sz, size_t n_structs);
gpointer g_new0_(size_t sz, size_t n_structs);
gpointer g_renew_(size_t sz, gpointer mem, size_t n_structs);
char *g_strconcat(const char *string1, ...);
gchar* g_strconcat (const gchar *string1, ...);
gchar** g_strsplit (const gchar *string,
const gchar *delimiter,
gint max_tokens);
char **g_strsplit(const char *string, const char *delimiter, int max_tokens);
#define g_new(struct_type, n_structs) ((struct_type*)g_new_(sizeof(struct_type), n_structs))
#define g_new0(struct_type, n_structs) ((struct_type*)g_new0_(sizeof(struct_type), n_structs))
#define g_renew(struct_type, mem, n_structs) ((struct_type*)g_renew_(sizeof(struct_type), mem, n_structs))
#ifdef _WIN32
char *g_win32_error_message(int error);
#endif
#endif

View File

@@ -38,16 +38,6 @@ void error_set(Error **errp, ErrorClass err_class, const char *fmt, ...)
void error_set_errno(Error **errp, int os_error, ErrorClass err_class,
const char *fmt, ...) GCC_FMT_ATTR(4, 5);
#ifdef _WIN32
/**
* Set an indirect pointer to an error given a ErrorClass value and a
* printf-style human message, followed by a g_win32_error_message() string if
* @win32_err is not zero.
*/
void error_set_win32(Error **errp, int win32_err, ErrorClass err_class,
const char *fmt, ...) GCC_FMT_ATTR(4, 5);
#endif
/**
* Same as error_set(), but sets a generic error
*/
@@ -56,11 +46,6 @@ void error_set_win32(Error **errp, int win32_err, ErrorClass err_class,
#define error_setg_errno(errp, os_error, fmt, ...) \
error_set_errno(errp, os_error, ERROR_CLASS_GENERIC_ERROR, \
fmt, ## __VA_ARGS__)
#ifdef _WIN32
#define error_setg_win32(errp, win32_err, fmt, ...) \
error_set_win32(errp, win32_err, ERROR_CLASS_GENERIC_ERROR, \
fmt, ## __VA_ARGS__)
#endif
/**
* Helper for open() errors