]> granicus.if.org Git - icu/commitdiff
ICU-11391 Fix data build on windows
authorMichael Ow <mow@svn.icu-project.org>
Fri, 9 Jan 2015 06:45:59 +0000 (06:45 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Fri, 9 Jan 2015 06:45:59 +0000 (06:45 +0000)
X-SVN-Rev: 36934

icu4c/source/tools/pkgdata/pkgdata.cpp

index cb56ccff6995dd8a53453cffa37dfa4590fc7cc1..3050460775ac241baf237e520ef525e0839f98d4 100644 (file)
@@ -2160,6 +2160,7 @@ static void loadLists(UPKGOptions *o, UErrorCode *status)
 #ifdef CAN_WRITE_OBJ_CODE
  /* Create optMatchArch for genccode architecture detection */
 static void pkg_createOptMatchArch(char *optMatchArch) {
+#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
     const char* code = "void oma(){}";
     const char* source = "oma.c";
     const char* obj = "oma.obj";
@@ -2189,9 +2190,10 @@ static void pkg_createOptMatchArch(char *optMatchArch) {
     else {
         fprintf(stderr, "T_FileStream_open failed to open %s for writing\n", source);
     }
+#endif
 }
 static void pkg_destroyOptMatchArch(char *optMatchArch) {
-    if(!T_FileStream_remove(optMatchArch)){
+    if(T_FileStream_file_exists(optMatchArch) && !T_FileStream_remove(optMatchArch)){
         fprintf(stderr, "T_FileStream_remove failed to delete %s\n", optMatchArch);
     }
 }