Fossil SCM
Add a compile-time option (WITHOUT_ICONV) that omits the use of iconv.h so that Fossil can be compiled on a 10-year-old PPC Macbook.
Commit
722791a6a8ee0c50428d9a01f9024db6a9db9f05
Parent
b41ebf256f78e75…
1 file changed
+2
-2
+2
-2
| --- src/utf8.c | ||
| +++ src/utf8.c | ||
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | #else |
| 102 | 102 | /* No-op on unix */ |
| 103 | 103 | #endif |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | -#if defined(__APPLE__) | |
| 106 | +#if defined(__APPLE__) && !defined(WITHOUT_ICONV) | |
| 107 | 107 | # include <iconv.h> |
| 108 | 108 | #endif |
| 109 | 109 | |
| 110 | 110 | /* |
| 111 | 111 | ** Translate text from the filename character set into |
| @@ -120,11 +120,11 @@ | ||
| 120 | 120 | if( zUtf==0 ){ |
| 121 | 121 | return 0; |
| 122 | 122 | } |
| 123 | 123 | WideCharToMultiByte(CP_UTF8, 0, zFilename, -1, zUtf, nByte, 0, 0); |
| 124 | 124 | return zUtf; |
| 125 | -#elif defined(__APPLE__) | |
| 125 | +#elif defined(__APPLE__) && !defined(WITHOUT_ICONV) | |
| 126 | 126 | char *zIn = (char*)zFilename; |
| 127 | 127 | char *zOut; |
| 128 | 128 | iconv_t cd; |
| 129 | 129 | size_t n, x; |
| 130 | 130 | for(n=0; zIn[n]>0 && zIn[n]<=0x7f; n++){} |
| 131 | 131 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | #else |
| 102 | /* No-op on unix */ |
| 103 | #endif |
| 104 | } |
| 105 | |
| 106 | #if defined(__APPLE__) |
| 107 | # include <iconv.h> |
| 108 | #endif |
| 109 | |
| 110 | /* |
| 111 | ** Translate text from the filename character set into |
| @@ -120,11 +120,11 @@ | |
| 120 | if( zUtf==0 ){ |
| 121 | return 0; |
| 122 | } |
| 123 | WideCharToMultiByte(CP_UTF8, 0, zFilename, -1, zUtf, nByte, 0, 0); |
| 124 | return zUtf; |
| 125 | #elif defined(__APPLE__) |
| 126 | char *zIn = (char*)zFilename; |
| 127 | char *zOut; |
| 128 | iconv_t cd; |
| 129 | size_t n, x; |
| 130 | for(n=0; zIn[n]>0 && zIn[n]<=0x7f; n++){} |
| 131 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | #else |
| 102 | /* No-op on unix */ |
| 103 | #endif |
| 104 | } |
| 105 | |
| 106 | #if defined(__APPLE__) && !defined(WITHOUT_ICONV) |
| 107 | # include <iconv.h> |
| 108 | #endif |
| 109 | |
| 110 | /* |
| 111 | ** Translate text from the filename character set into |
| @@ -120,11 +120,11 @@ | |
| 120 | if( zUtf==0 ){ |
| 121 | return 0; |
| 122 | } |
| 123 | WideCharToMultiByte(CP_UTF8, 0, zFilename, -1, zUtf, nByte, 0, 0); |
| 124 | return zUtf; |
| 125 | #elif defined(__APPLE__) && !defined(WITHOUT_ICONV) |
| 126 | char *zIn = (char*)zFilename; |
| 127 | char *zOut; |
| 128 | iconv_t cd; |
| 129 | size_t n, x; |
| 130 | for(n=0; zIn[n]>0 && zIn[n]<=0x7f; n++){} |
| 131 |