Fossil SCM
unbreak win32
Commit
0ff5b5ed0f6a3934aaa1d5dcd4be3e93bf5eff83
Parent
c24e568fb0d3f5d…
1 file changed
+7
-4
+7
-4
| --- src/utf8.c | ||
| +++ src/utf8.c | ||
| @@ -20,10 +20,13 @@ | ||
| 20 | 20 | ** filesystem and operating system. |
| 21 | 21 | */ |
| 22 | 22 | #include "config.h" |
| 23 | 23 | #include "utf8.h" |
| 24 | 24 | #include <sqlite3.h> |
| 25 | +#ifdef _WIN32 | |
| 26 | +# include <windows.h> | |
| 27 | +#endif | |
| 25 | 28 | |
| 26 | 29 | /* |
| 27 | 30 | ** Translate MBCS to UTF8. Return a pointer to the translated text. |
| 28 | 31 | ** Call fossil_mbcs_free() to deallocate any memory used to store the |
| 29 | 32 | ** returned pointer when done. |
| @@ -90,13 +93,13 @@ | ||
| 90 | 93 | |
| 91 | 94 | /* |
| 92 | 95 | ** Deallocate any memory that was previously allocated by |
| 93 | 96 | ** fossil_unicode_to_utf8(). |
| 94 | 97 | */ |
| 95 | -void fossil_unicode_free(char *pOld){ | |
| 98 | +void fossil_unicode_free(void *pOld){ | |
| 96 | 99 | #ifdef _WIN32 |
| 97 | - sqlite3_free(zOld); | |
| 100 | + sqlite3_free(pOld); | |
| 98 | 101 | #else |
| 99 | 102 | /* No-op on unix */ |
| 100 | 103 | #endif |
| 101 | 104 | } |
| 102 | 105 | |
| @@ -148,13 +151,13 @@ | ||
| 148 | 151 | ** Deallocate any memory that was previously allocated by |
| 149 | 152 | ** fossil_filename_to_utf8(). |
| 150 | 153 | */ |
| 151 | 154 | void fossil_filename_free(char *pOld){ |
| 152 | 155 | #if defined(_WIN32) |
| 153 | - sqlite3_free(zOld); | |
| 156 | + sqlite3_free(pOld); | |
| 154 | 157 | #elif defined(__APPLE__) |
| 155 | - fossil_free(zOld); | |
| 158 | + fossil_free(pOld); | |
| 156 | 159 | #else |
| 157 | 160 | /* No-op on all other unix */ |
| 158 | 161 | #endif |
| 159 | 162 | } |
| 160 | 163 | |
| 161 | 164 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -20,10 +20,13 @@ | |
| 20 | ** filesystem and operating system. |
| 21 | */ |
| 22 | #include "config.h" |
| 23 | #include "utf8.h" |
| 24 | #include <sqlite3.h> |
| 25 | |
| 26 | /* |
| 27 | ** Translate MBCS to UTF8. Return a pointer to the translated text. |
| 28 | ** Call fossil_mbcs_free() to deallocate any memory used to store the |
| 29 | ** returned pointer when done. |
| @@ -90,13 +93,13 @@ | |
| 90 | |
| 91 | /* |
| 92 | ** Deallocate any memory that was previously allocated by |
| 93 | ** fossil_unicode_to_utf8(). |
| 94 | */ |
| 95 | void fossil_unicode_free(char *pOld){ |
| 96 | #ifdef _WIN32 |
| 97 | sqlite3_free(zOld); |
| 98 | #else |
| 99 | /* No-op on unix */ |
| 100 | #endif |
| 101 | } |
| 102 | |
| @@ -148,13 +151,13 @@ | |
| 148 | ** Deallocate any memory that was previously allocated by |
| 149 | ** fossil_filename_to_utf8(). |
| 150 | */ |
| 151 | void fossil_filename_free(char *pOld){ |
| 152 | #if defined(_WIN32) |
| 153 | sqlite3_free(zOld); |
| 154 | #elif defined(__APPLE__) |
| 155 | fossil_free(zOld); |
| 156 | #else |
| 157 | /* No-op on all other unix */ |
| 158 | #endif |
| 159 | } |
| 160 | |
| 161 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -20,10 +20,13 @@ | |
| 20 | ** filesystem and operating system. |
| 21 | */ |
| 22 | #include "config.h" |
| 23 | #include "utf8.h" |
| 24 | #include <sqlite3.h> |
| 25 | #ifdef _WIN32 |
| 26 | # include <windows.h> |
| 27 | #endif |
| 28 | |
| 29 | /* |
| 30 | ** Translate MBCS to UTF8. Return a pointer to the translated text. |
| 31 | ** Call fossil_mbcs_free() to deallocate any memory used to store the |
| 32 | ** returned pointer when done. |
| @@ -90,13 +93,13 @@ | |
| 93 | |
| 94 | /* |
| 95 | ** Deallocate any memory that was previously allocated by |
| 96 | ** fossil_unicode_to_utf8(). |
| 97 | */ |
| 98 | void fossil_unicode_free(void *pOld){ |
| 99 | #ifdef _WIN32 |
| 100 | sqlite3_free(pOld); |
| 101 | #else |
| 102 | /* No-op on unix */ |
| 103 | #endif |
| 104 | } |
| 105 | |
| @@ -148,13 +151,13 @@ | |
| 151 | ** Deallocate any memory that was previously allocated by |
| 152 | ** fossil_filename_to_utf8(). |
| 153 | */ |
| 154 | void fossil_filename_free(char *pOld){ |
| 155 | #if defined(_WIN32) |
| 156 | sqlite3_free(pOld); |
| 157 | #elif defined(__APPLE__) |
| 158 | fossil_free(pOld); |
| 159 | #else |
| 160 | /* No-op on all other unix */ |
| 161 | #endif |
| 162 | } |
| 163 | |
| 164 |