diff -r 6112bcc5d1cf -r 2e896ad9754b librazor/error.c --- a/librazor/error.c Sat Feb 11 23:50:26 2012 +0000 +++ b/librazor/error.c Fri Feb 17 18:35:10 2012 +0000 @@ -62,37 +62,43 @@ return error; } -#endif -#if HAVE_WINDOWS_KTM struct razor_error * -razor_error_new_str(const wchar_t *path, const char *str) -#else -struct razor_error * -razor_error_new_str(const char *path, const char *str) -#endif +razor_error_new_str2(const wchar_t *path, const char *str) { struct razor_error *error; error = zalloc(sizeof *error); -#if HAVE_WINDOWS_KTM if (path) error->path = razor_utf16_to_utf8(path, -1); -#else + + error->str = strdup(str); + + return error; +} +#endif /* MSWIN_API */ + +RAZOR_EXPORT struct razor_error * +razor_error_new_str(const char *path, const char *str) +{ + struct razor_error *error; + + error = zalloc(sizeof *error); + if (path) error->path = strdup(path); -#endif error->str = strdup(str); return error; } -void razor_error_free(struct razor_error *error) +RAZOR_EXPORT void +razor_error_free(struct razor_error *error) { - free(error->path); - free(error->str); - free(error->msg); - free(error); + free(error->path); + free(error->str); + free(error->msg); + free(error); }