Windows/MSVC utf8 build fixes
authorErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 28 Jan 2016 20:39:12 +0000 (07:39 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 28 Jan 2016 20:39:16 +0000 (07:39 +1100)
Files share/utf8/charset.c and share/utf8/iconvert.c aren't needed
under Windows. This patch removes them from MSVC build system.

Patch-from: lvqcl <lvqcl.mail@gmail.com>

src/share/utf8/charset.c
src/share/utf8/iconvert.c
src/share/utf8/utf8.c
src/share/utf8/utf8_static.vcproj
src/share/utf8/utf8_static.vcxproj
src/share/utf8/utf8_static.vcxproj.filters

index 3e8d8ec..5a2a6e4 100644 (file)
@@ -31,7 +31,7 @@
 #  include <config.h>
 #endif
 
-#ifndef HAVE_ICONV /* should be ifdef USE_CHARSET_CONVERT */
+#if !defined _WIN32 && !defined HAVE_ICONV /* should be && defined USE_CHARSET_CONVERT */
 
 #include <stdlib.h>
 
index f76c18b..472ca87 100644 (file)
@@ -20,7 +20,7 @@
 #  include <config.h>
 #endif
 
-#ifdef HAVE_ICONV
+#if !defined _WIN32 && defined HAVE_ICONV
 
 #include <assert.h>
 #include <errno.h>
index fbac932..f886e32 100644 (file)
@@ -33,7 +33,6 @@
 #include "share/alloc.h"
 #include "share/safe_str.h"
 #include "share/utf8.h"
-#include "charset.h"
 
 
 #ifdef _WIN32
@@ -247,6 +246,7 @@ int utf8_decode(const char *from, char **to)
 #endif
 
 #include "iconvert.h"
+#include "charset.h"
 
 static const char *current_charset(void)
 {
index 9f87810..87b8ad5 100644 (file)
                        Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
                        >\r
-                       <File\r
-                               RelativePath=".\charmaps.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\charset.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\charsetmap.h"\r
-                               >\r
-                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="Public Header Files"\r
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
                        >\r
                        <File\r
-                               RelativePath=".\charset.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\iconvert.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath=".\utf8.c"\r
                                >\r
                        </File>\r
index 53e1c1e..5298e92 100644 (file)
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\include\share\utf8.h" />\r
-    <ClInclude Include="charmaps.h" />\r
-    <ClInclude Include="charset.h" />\r
-    <ClInclude Include="charsetmap.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="charset.c" />\r
-    <ClCompile Include="iconvert.c" />\r
     <ClCompile Include="utf8.c" />\r
   </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
index 78ba12b..dfbaa99 100644 (file)
     </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClInclude Include="charmaps.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="charset.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="charsetmap.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\..\..\include\share\utf8.h">\r
       <Filter>Public Header Files</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="charset.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="iconvert.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="utf8.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r