ICU-20677 Fixing cygwin/MSVC build

See #1398
This commit is contained in:
Artemkth 2020-10-07 20:31:25 +00:00 committed by Jeff Genovy
parent a3d83dedba
commit 6e99377bc5
3 changed files with 7 additions and 14 deletions

View File

@ -240,8 +240,7 @@ include $(top_builddir)/$(subdir)/rules.mk
ifeq ($(ENABLE_SO_VERSION_DATA),1)
ifeq ($(PKGDATA_MODE),dll)
SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res
$(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc
mkdir -p $(@D)
$(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc | $(TMP_DIR)/dirs.timestamp
ifeq ($(MSYS_RC_MODE),1)
rc.exe -i$(srcdir)/../common -i$(top_builddir)/common -fo$@ $(CPPFLAGS) $<
else

View File

@ -12,9 +12,6 @@ top_builddir = ../..
include $(top_builddir)/icudefs.mk
## Platform-specific setup
include @platform_make_fragment@
## Build directory information
subdir = extra/scrptrun
@ -22,7 +19,7 @@ subdir = extra/scrptrun
CLEANFILES = *~ $(DEPS)
## Target information
TARGET = srtest
TARGET = srtest$(EXEEXT)
DEFS = @DEFS@
CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I$(top_srcdir)

View File

@ -166,14 +166,11 @@ findBasename(const char *filename) {
const char *basename=uprv_strrchr(filename, U_FILE_SEP_CHAR);
#if U_FILE_ALT_SEP_CHAR!=U_FILE_SEP_CHAR
#if !(U_PLATFORM == U_PF_CYGWIN && U_PLATFORM_USES_ONLY_WIN32_API)
if(basename==NULL)
#endif
{
/* Use lenient matching on Windows, which can accept either \ or /
This is useful for environments like Win32+CygWin which have both.
*/
basename=uprv_strrchr(filename, U_FILE_ALT_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
const char *alt_basename=uprv_strrchr(filename, U_FILE_ALT_SEP_CHAR);
if(alt_basename>basename) {
basename=alt_basename;
}
#endif