X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/efa1e6592fb03ce23b15276b2b91d885a3ee7da5..57a6839dcb3bba09e8228b822b290604668416fe:/icuSources/tools/toolutil/toolutil.cpp diff --git a/icuSources/tools/toolutil/toolutil.cpp b/icuSources/tools/toolutil/toolutil.cpp index 7c02efc3..0dbdaaeb 100644 --- a/icuSources/tools/toolutil/toolutil.cpp +++ b/icuSources/tools/toolutil/toolutil.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1999-2011, International Business Machines +* Copyright (C) 1999-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -18,6 +18,14 @@ * This file contains utility functions for ICU tools like genccode. */ +#include "unicode/platform.h" +#if U_PLATFORM == U_PF_MINGW +// *cough* - for struct stat +#ifdef __STRICT_ANSI__ +#undef __STRICT_ANSI__ +#endif +#endif + #include #include #include "unicode/utypes.h" @@ -33,6 +41,9 @@ # define NOSERVICE # define NOIME # define NOMCX +# if U_PLATFORM == U_PF_MINGW +# define __NO_MINGW_LFS /* gets around missing 'off64_t' */ +# endif # include # include #else @@ -191,6 +202,18 @@ uprv_mkdir(const char *pathname, UErrorCode *status) { } } +#if !UCONFIG_NO_FILE_IO +U_CAPI UBool U_EXPORT2 +uprv_fileExists(const char *file) { + struct stat stat_buf; + if (stat(file, &stat_buf) == 0) { + return TRUE; + } else { + return FALSE; + } +} +#endif + /*U_CAPI UDate U_EXPORT2 uprv_getModificationDate(const char *pathname, UErrorCode *status) {