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.

drh 2012-12-11 16:23 trunk
Commit 722791a6a8ee0c50428d9a01f9024db6a9db9f05
1 file changed +2 -2
+2 -2
--- src/utf8.c
+++ src/utf8.c
@@ -101,11 +101,11 @@
101101
#else
102102
/* No-op on unix */
103103
#endif
104104
}
105105
106
-#if defined(__APPLE__)
106
+#if defined(__APPLE__) && !defined(WITHOUT_ICONV)
107107
# include <iconv.h>
108108
#endif
109109
110110
/*
111111
** Translate text from the filename character set into
@@ -120,11 +120,11 @@
120120
if( zUtf==0 ){
121121
return 0;
122122
}
123123
WideCharToMultiByte(CP_UTF8, 0, zFilename, -1, zUtf, nByte, 0, 0);
124124
return zUtf;
125
-#elif defined(__APPLE__)
125
+#elif defined(__APPLE__) && !defined(WITHOUT_ICONV)
126126
char *zIn = (char*)zFilename;
127127
char *zOut;
128128
iconv_t cd;
129129
size_t n, x;
130130
for(n=0; zIn[n]>0 && zIn[n]<=0x7f; n++){}
131131
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button