#ifndef U_TOOLUTIL_IMPLEMENTATION #error U_TOOLUTIL_IMPLEMENTATION not set - must be set for all ICU source files in common/ - see https://unicode-org.github.io/icu/userguide/howtouseicu #endif
#if U_PLATFORM_USES_ONLY_WIN32_API # define VC_EXTRALEAN # define WIN32_LEAN_AND_MEAN # define NOUSER # define NOSERVICE # define NOIME # define NOMCX # if U_PLATFORM == U_PF_MINGW # define __NO_MINGW_LFS /* gets around missing 'off64_t' */ # endif # include <windows.h> # include <direct.h> #else # include <sys/stat.h> # include <sys/types.h> #endif
/* In MinGW environment, io.h needs to be included for _mkdir() */ #if U_PLATFORM == U_PF_MINGW #include <io.h> #endif
void setCPTrieBits(UMutableCPTrie *mutableCPTrie,
UChar32 start, UChar32 end, uint32_t mask, uint32_t value,
UErrorCode &errorCode) { if (U_FAILURE(errorCode)) { return; } // The value must not have any bits set outside of the mask. if ((value & ~mask) != 0) {
errorCode = U_ILLEGAL_ARGUMENT_ERROR; return;
}
U_CAPI constchar * U_EXPORT2
getLongPathname(constchar *pathname) { #if U_PLATFORM_USES_ONLY_WIN32_API /* anticipate problems with "short" pathnames */ static WIN32_FIND_DATAA info;
HANDLE file=FindFirstFileA(pathname, &info); if(file!=INVALID_HANDLE_VALUE) { if(info.cAlternateFileName[0]!=0) { /* this file has a short name, get and use the long one */ constchar *basename=findBasename(pathname); if(basename!=pathname) { /* prepend the long filename with the original path */
uprv_memmove(info.cFileName+(basename-pathname), info.cFileName, uprv_strlen(info.cFileName)+1);
uprv_memcpy(info.cFileName, pathname, basename-pathname);
}
pathname=info.cFileName;
}
FindClose(file);
} #endif return pathname;
}
#if U_FILE_ALT_SEP_CHAR!=U_FILE_SEP_CHAR //be lenient about pathname separators on Windows, like official implementation of C++17 std::filesystem in MSVC //would be convenient to merge this loop with the one above, but alas, there is no such solution in the standard library constchar *alt_basename=uprv_strrchr(filename, U_FILE_ALT_SEP_CHAR); if(alt_basename>basename) {
basename=alt_basename;
} #endif
int retVal = 0; #if U_PLATFORM_USES_ONLY_WIN32_API
retVal = _mkdir(pathname); #else
retVal = mkdir(pathname, S_IRWXU | (S_IROTH | S_IXOTH) | (S_IROTH | S_IXOTH)); #endif if (retVal && errno != EEXIST) { #if U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN /*if using Cygwin and the mkdir says it failed...check if the directory already exists..*/ /* if it does...don't give the error, if it does not...give the error - Brian Rower - 6/25/08 */ struct stat st;
if(mem->maxCapacity<capacity) {
fprintf(stderr, "error: %s - trying to use more than maxCapacity=%ld units\n",
mem->name, static_cast<long>(mem->maxCapacity)); exit(U_MEMORY_ALLOCATION_ERROR);
}
/* try to allocate a larger array */ if(capacity>=2*mem->capacity) {
newCapacity=capacity;
} elseif(mem->capacity<=mem->maxCapacity/3) {
newCapacity=2*mem->capacity;
} else {
newCapacity=mem->maxCapacity;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.