1.1 --- a/librazor/error.c Sat Feb 11 23:50:26 2012 +0000
1.2 +++ b/librazor/error.c Fri Mar 23 20:24:09 2012 +0000
1.3 @@ -62,37 +62,43 @@
1.4
1.5 return error;
1.6 }
1.7 -#endif
1.8
1.9 -#if HAVE_WINDOWS_KTM
1.10 struct razor_error *
1.11 -razor_error_new_str(const wchar_t *path, const char *str)
1.12 -#else
1.13 -struct razor_error *
1.14 -razor_error_new_str(const char *path, const char *str)
1.15 -#endif
1.16 +razor_error_new_str2(const wchar_t *path, const char *str)
1.17 {
1.18 struct razor_error *error;
1.19
1.20 error = zalloc(sizeof *error);
1.21
1.22 -#if HAVE_WINDOWS_KTM
1.23 if (path)
1.24 error->path = razor_utf16_to_utf8(path, -1);
1.25 -#else
1.26 +
1.27 + error->str = strdup(str);
1.28 +
1.29 + return error;
1.30 +}
1.31 +#endif /* MSWIN_API */
1.32 +
1.33 +RAZOR_EXPORT struct razor_error *
1.34 +razor_error_new_str(const char *path, const char *str)
1.35 +{
1.36 + struct razor_error *error;
1.37 +
1.38 + error = zalloc(sizeof *error);
1.39 +
1.40 if (path)
1.41 error->path = strdup(path);
1.42 -#endif
1.43
1.44 error->str = strdup(str);
1.45
1.46 return error;
1.47 }
1.48
1.49 -void razor_error_free(struct razor_error *error)
1.50 +RAZOR_EXPORT void
1.51 +razor_error_free(struct razor_error *error)
1.52 {
1.53 - free(error->path);
1.54 - free(error->str);
1.55 - free(error->msg);
1.56 - free(error);
1.57 + free(error->path);
1.58 + free(error->str);
1.59 + free(error->msg);
1.60 + free(error);
1.61 }