Imported Upstream version 6.8.0.73

Former-commit-id: d18deab1b47cfd3ad8cba82b3f37d00eec2170af
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-12-10 18:00:56 +00:00
parent bceda29824
commit 73ee7591e8
1043 changed files with 16271 additions and 22080 deletions

View File

@@ -1,9 +1,8 @@
include $(top_srcdir)/mk/common.mk
# FIXME
#SUBDIRS = test
if !ENABLE_MSVC_ONLY
DIST_SUBDIRS = test
SUBDIRS = . test
noinst_LTLIBRARIES = libeglib.la
@@ -55,8 +54,12 @@ libeglib_la_SOURCES = \
unicode-data.h \
$(os_files)
endif # !ENABLE_MSVC_ONLY
CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@
if !ENABLE_MSVC_ONLY
eglibdir=$(datadir)/mono-$(API_VER)/mono/eglib
eglib_DATA = eglib-config.h
@@ -77,3 +80,18 @@ endif
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
endif # !ENABLE_MSVC_ONLY
if ENABLE_MSVC_ONLY
all-local:
make -C $(top_srcdir)/msvc eglib
clean-local:
make -C $(top_srcdir)/msvc clean-eglib
endif # ENABLE_MSVC_ONLY

View File

@@ -91,7 +91,6 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = mono/eglib
SUBDIRS =
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \
$(top_srcdir)/m4/ax_append_flag.m4 \
@@ -123,27 +122,48 @@ am__libeglib_la_SOURCES_DIST = eglib-remap.h sort.frag.h glib.h \
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c \
gunicode-win32.c
am__objects_1 = libeglib_la-gdate-unix.lo libeglib_la-gdir-unix.lo \
libeglib_la-gfile-unix.lo libeglib_la-gmisc-unix.lo \
libeglib_la-gmodule-unix.lo libeglib_la-gtimer-unix.lo
am__objects_2 = libeglib_la-gdate-win32.lo libeglib_la-gdir-win32.lo \
libeglib_la-gfile-win32.lo libeglib_la-gmisc-win32.lo \
libeglib_la-gmodule-win32.lo libeglib_la-gtimer-win32.lo \
libeglib_la-gunicode-win32.lo
@HOST_WIN32_FALSE@am__objects_3 = $(am__objects_1)
@HOST_WIN32_TRUE@am__objects_3 = $(am__objects_2)
am_libeglib_la_OBJECTS = libeglib_la-garray.lo \
libeglib_la-gbytearray.lo libeglib_la-gerror.lo \
libeglib_la-ghashtable.lo libeglib_la-giconv.lo \
libeglib_la-gmem.lo libeglib_la-goutput.lo \
libeglib_la-gqsort.lo libeglib_la-gstr.lo \
libeglib_la-gslist.lo libeglib_la-gstring.lo \
libeglib_la-gptrarray.lo libeglib_la-glist.lo \
libeglib_la-gqueue.lo libeglib_la-gpath.lo \
libeglib_la-gshell.lo libeglib_la-gspawn.lo \
libeglib_la-gfile.lo libeglib_la-gfile-posix.lo \
libeglib_la-gpattern.lo libeglib_la-gmarkup.lo \
libeglib_la-gutf8.lo libeglib_la-gunicode.lo $(am__objects_3)
@ENABLE_MSVC_ONLY_FALSE@am__objects_1 = libeglib_la-gdate-unix.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gdir-unix.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile-unix.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmisc-unix.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmodule-unix.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gtimer-unix.lo
@ENABLE_MSVC_ONLY_FALSE@am__objects_2 = libeglib_la-gdate-win32.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gdir-win32.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile-win32.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmisc-win32.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmodule-win32.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gtimer-win32.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gunicode-win32.lo
@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@am__objects_3 = \
@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@ $(am__objects_1)
@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@am__objects_3 = \
@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@ $(am__objects_2)
@ENABLE_MSVC_ONLY_FALSE@am_libeglib_la_OBJECTS = \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-garray.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gbytearray.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gerror.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-ghashtable.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-giconv.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmem.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-goutput.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gqsort.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gstr.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gslist.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gstring.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gptrarray.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-glist.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gqueue.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gpath.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gshell.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gspawn.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile-posix.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gpattern.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmarkup.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gutf8.lo \
@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gunicode.lo \
@ENABLE_MSVC_ONLY_FALSE@ $(am__objects_3)
libeglib_la_OBJECTS = $(am_libeglib_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -152,6 +172,7 @@ am__v_lt_1 =
libeglib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libeglib_la_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_MSVC_ONLY_FALSE@am_libeglib_la_rpath =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -254,6 +275,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = . test
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/eglib-config.h.in \
$(top_srcdir)/depcomp $(top_srcdir)/mk/common.mk \
$(top_srcdir)/mkinstalldirs
@@ -366,6 +388,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERP_CFLAGS = @INTERP_CFLAGS@
INTL = @INTL@
INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@
JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@
@@ -555,63 +578,60 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
@ENABLE_MSVC_ONLY_FALSE@SUBDIRS = . test
@ENABLE_MSVC_ONLY_FALSE@noinst_LTLIBRARIES = libeglib.la
@ENABLE_MSVC_ONLY_FALSE@AM_CFLAGS = $(WERROR_CFLAGS)
@ENABLE_MSVC_ONLY_FALSE@win_files = \
@ENABLE_MSVC_ONLY_FALSE@ eglib-config.hw \
@ENABLE_MSVC_ONLY_FALSE@ gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
@ENABLE_MSVC_ONLY_FALSE@ gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c gunicode-win32.c
# FIXME
#SUBDIRS = test
DIST_SUBDIRS = test
noinst_LTLIBRARIES = libeglib.la
AM_CFLAGS = $(WERROR_CFLAGS)
win_files = \
eglib-config.hw \
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c gunicode-win32.c
@ENABLE_MSVC_ONLY_FALSE@unix_files = \
@ENABLE_MSVC_ONLY_FALSE@ gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
@ENABLE_MSVC_ONLY_FALSE@ gmodule-unix.c gtimer-unix.c
unix_files = \
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
gmodule-unix.c gtimer-unix.c
@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@os_files = $(unix_files)
@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@os_files = $(win_files)
@ENABLE_MSVC_ONLY_FALSE@libeglib_la_SOURCES = \
@ENABLE_MSVC_ONLY_FALSE@ eglib-remap.h \
@ENABLE_MSVC_ONLY_FALSE@ sort.frag.h \
@ENABLE_MSVC_ONLY_FALSE@ glib.h \
@ENABLE_MSVC_ONLY_FALSE@ garray.c \
@ENABLE_MSVC_ONLY_FALSE@ gbytearray.c \
@ENABLE_MSVC_ONLY_FALSE@ gerror.c \
@ENABLE_MSVC_ONLY_FALSE@ ghashtable.c \
@ENABLE_MSVC_ONLY_FALSE@ giconv.c \
@ENABLE_MSVC_ONLY_FALSE@ gmem.c \
@ENABLE_MSVC_ONLY_FALSE@ gmodule.h \
@ENABLE_MSVC_ONLY_FALSE@ goutput.c \
@ENABLE_MSVC_ONLY_FALSE@ gqsort.c \
@ENABLE_MSVC_ONLY_FALSE@ gstr.c \
@ENABLE_MSVC_ONLY_FALSE@ gslist.c \
@ENABLE_MSVC_ONLY_FALSE@ gstring.c \
@ENABLE_MSVC_ONLY_FALSE@ gptrarray.c \
@ENABLE_MSVC_ONLY_FALSE@ glist.c \
@ENABLE_MSVC_ONLY_FALSE@ gqueue.c \
@ENABLE_MSVC_ONLY_FALSE@ gpath.c \
@ENABLE_MSVC_ONLY_FALSE@ gshell.c \
@ENABLE_MSVC_ONLY_FALSE@ gspawn.c \
@ENABLE_MSVC_ONLY_FALSE@ gfile.c \
@ENABLE_MSVC_ONLY_FALSE@ gfile-posix.c \
@ENABLE_MSVC_ONLY_FALSE@ gpattern.c \
@ENABLE_MSVC_ONLY_FALSE@ gmarkup.c \
@ENABLE_MSVC_ONLY_FALSE@ gutf8.c \
@ENABLE_MSVC_ONLY_FALSE@ gunicode.c \
@ENABLE_MSVC_ONLY_FALSE@ unicode-data.h \
@ENABLE_MSVC_ONLY_FALSE@ $(os_files)
@HOST_WIN32_FALSE@os_files = $(unix_files)
@HOST_WIN32_TRUE@os_files = $(win_files)
libeglib_la_SOURCES = \
eglib-remap.h \
sort.frag.h \
glib.h \
garray.c \
gbytearray.c \
gerror.c \
ghashtable.c \
giconv.c \
gmem.c \
gmodule.h \
goutput.c \
gqsort.c \
gstr.c \
gslist.c \
gstring.c \
gptrarray.c \
glist.c \
gqueue.c \
gpath.c \
gshell.c \
gspawn.c \
gfile.c \
gfile-posix.c \
gpattern.c \
gmarkup.c \
gutf8.c \
gunicode.c \
unicode-data.h \
$(os_files)
eglibdir = $(datadir)/mono-$(API_VER)/mono/eglib
eglib_DATA = eglib-config.h
libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
AM_CPPFLAGS = -I$(srcdir)
@HOST_ANDROID_FALSE@@HOST_WIN32_FALSE@libeglib_la_LIBADD = -lm $(LTLIBICONV)
@HOST_ANDROID_FALSE@@HOST_WIN32_TRUE@libeglib_la_LIBADD = -lm -lpsapi $(LTLIBICONV)
@HOST_ANDROID_TRUE@libeglib_la_LIBADD = -lm -llog
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
@ENABLE_MSVC_ONLY_FALSE@eglibdir = $(datadir)/mono-$(API_VER)/mono/eglib
@ENABLE_MSVC_ONLY_FALSE@eglib_DATA = eglib-config.h
@ENABLE_MSVC_ONLY_FALSE@libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = -I$(srcdir)
@ENABLE_MSVC_ONLY_FALSE@@HOST_ANDROID_FALSE@@HOST_WIN32_FALSE@libeglib_la_LIBADD = -lm $(LTLIBICONV)
@ENABLE_MSVC_ONLY_FALSE@@HOST_ANDROID_FALSE@@HOST_WIN32_TRUE@libeglib_la_LIBADD = -lm -lpsapi $(LTLIBICONV)
@ENABLE_MSVC_ONLY_FALSE@@HOST_ANDROID_TRUE@libeglib_la_LIBADD = -lm -llog
@ENABLE_MSVC_ONLY_FALSE@MAINTAINERCLEANFILES = Makefile.in
@ENABLE_MSVC_ONLY_FALSE@EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
all: all-recursive
.SUFFIXES:
@@ -661,7 +681,7 @@ clean-noinstLTLIBRARIES:
}
libeglib.la: $(libeglib_la_OBJECTS) $(libeglib_la_DEPENDENCIES) $(EXTRA_libeglib_la_DEPENDENCIES)
$(AM_V_CCLD)$(libeglib_la_LINK) $(libeglib_la_OBJECTS) $(libeglib_la_LIBADD) $(LIBS)
$(AM_V_CCLD)$(libeglib_la_LINK) $(am_libeglib_la_rpath) $(libeglib_la_OBJECTS) $(libeglib_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -707,25 +727,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gutf8.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
@@ -1167,7 +1184,8 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(DATA)
@ENABLE_MSVC_ONLY_FALSE@all-local:
all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(eglibdir)"; do \
@@ -1204,10 +1222,11 @@ maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
@ENABLE_MSVC_ONLY_FALSE@clean-local:
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
clean-am: clean-generic clean-libtool clean-local \
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
@@ -1285,8 +1304,8 @@ uninstall-am: uninstall-eglibDATA
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool \
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
check check-am clean clean-generic clean-libtool clean-local \
clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
@@ -1304,6 +1323,14 @@ uninstall-am: uninstall-eglibDATA
.PRECIOUS: Makefile
@ENABLE_MSVC_ONLY_TRUE@all-local:
@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc eglib
@ENABLE_MSVC_ONLY_TRUE@clean-local:
@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc clean-eglib
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -16,6 +16,7 @@
#define g_array_set_size monoeg_g_array_set_size
#define g_array_sized_new monoeg_g_array_sized_new
#define g_ascii_strdown monoeg_g_ascii_strdown
#define g_ascii_strdown_no_alloc monoeg_g_ascii_strdown_no_alloc
#define g_ascii_strncasecmp monoeg_g_ascii_strncasecmp
#define g_ascii_tolower monoeg_g_ascii_tolower
#define g_ascii_xdigit_value monoeg_g_ascii_xdigit_value

View File

@@ -141,7 +141,7 @@ g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **gerror)
return -1;
}
t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
t = g_build_filename (g_get_tmp_dir (), tmpl, (const char*)NULL);
fd = mkstemp (t);

View File

@@ -114,11 +114,8 @@ g_file_test (const gchar *filename, GFileTest test)
}
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
size_t len = strlen (filename);
if (len > 4 && strcmp (filename + len-3, "exe"))
return TRUE;
return FALSE;
/* Testing executable permission on Windows is hard, and this is unused, treat as EXISTS for now. */
return TRUE;
}
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {

View File

@@ -403,6 +403,7 @@ gchar *g_stpcpy (gchar *dest, const char *src);
gchar g_ascii_tolower (gchar c);
gchar g_ascii_toupper (gchar c);
gchar *g_ascii_strdown (const gchar *str, gssize len);
void g_ascii_strdown_no_alloc (char* dst, const char* src, gsize len);
gchar *g_ascii_strup (const gchar *str, gssize len);
gint g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n);
gint g_ascii_strcasecmp (const gchar *s1, const gchar *s2);
@@ -414,6 +415,32 @@ gint g_ascii_xdigit_value (gchar c);
gboolean g_utf16_ascii_equal (const gunichar2 *utf16, size_t ulen, const char *ascii, size_t alen);
gboolean g_utf16_asciiz_equal (const gunichar2 *utf16, const char *ascii);
static inline
gboolean g_ascii_equal (const char *s1, gsize len1, const char *s2, gsize len2)
{
return len1 == len2 && (s1 == s2 || memcmp (s1, s2, len1) == 0);
}
static inline
gboolean g_asciiz_equal (const char *s1, const char *s2)
{
return s1 == s2 || strcmp (s1, s2) == 0;
}
static inline
gboolean
g_ascii_equal_caseinsensitive (const char *s1, gsize len1, const char *s2, gsize len2)
{
return len1 == len2 && (s1 == s2 || g_ascii_strncasecmp (s1, s2, len1) == 0);
}
static inline
gboolean
g_asciiz_equal_caseinsensitive (const char *s1, const char *s2)
{
return s1 == s2 || g_ascii_strcasecmp (s1, s2) == 0;
}
/* FIXME: g_strcasecmp supports utf8 unicode stuff */
#ifdef _MSC_VER
#define g_strcasecmp _stricmp
@@ -1389,8 +1416,42 @@ glong g_utf8_pointer_to_offset (const gchar *str, const gchar *pos);
#define G_HAVE_API_SUPPORT(x) (x)
#define G_UNSUPPORTED_API "%s:%d: '%s' not supported.", __FILE__, __LINE__
#define g_unsupported_api(name) G_STMT_START { g_warning (G_UNSUPPORTED_API, name); } G_STMT_END
G_END_DECLS
// g_free the result
// No MAX_PATH limit.
gboolean
mono_get_module_filename (gpointer mod, gunichar2 **pstr, guint32 *plength);
// g_free the result
// No MAX_PATH limit.
gboolean
mono_get_module_filename_ex (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength);
// g_free the result
// No MAX_PATH limit.
gboolean
mono_get_module_basename (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength);
// g_free the result
// No MAX_PATH limit.
gboolean
mono_get_current_directory (gunichar2 **pstr, guint32 *plength);
G_END_DECLS // FIXME: There is more extern C than there should be.
static inline
void
mono_qsort (void* base, size_t num, size_t size, int (*compare)(const void*, const void*))
{
g_assert (compare);
g_assert (size);
if (num < 2 || !size || !base)
return;
qsort (base, num, size, compare);
}
#define MONO_DECL_CALLBACK(prefix, ret, name, sig) ret (*name) sig;
#define MONO_INIT_CALLBACK(prefix, ret, name, sig) prefix ## _ ## name,
// For each allocator; i.e. returning gpointer that needs to be cast.
// Macros do not recurse, so naming function and macro the same is ok.

View File

@@ -36,7 +36,7 @@ g_list_alloc (void)
return g_new0 (GList, 1);
}
static inline GList*
static GList*
new_node (GList *prev, gpointer data, GList *next)
{
GList *node = g_list_alloc ();
@@ -50,7 +50,7 @@ new_node (GList *prev, gpointer data, GList *next)
return node;
}
static inline GList*
static GList*
disconnect_node (GList *node)
{
if (node->next)

View File

@@ -53,7 +53,8 @@ g_getenv(const gchar *variable)
gint32 buffer_size = 1024;
gint32 retval;
var = u8to16(variable);
buffer = g_malloc(buffer_size*sizeof(gunichar2));
// FIXME This should loop in case another thread is growing the data.
buffer = g_new (gunichar2, buffer_size);
retval = GetEnvironmentVariableW (var, buffer, buffer_size);
if (retval != 0) {
if (retval > buffer_size) {
@@ -149,7 +150,7 @@ g_get_known_folder_path (void)
#else
static inline gchar *
static gchar *
g_get_known_folder_path (void)
{
return NULL;

View File

@@ -100,6 +100,9 @@ g_module_close (GModule *module)
}
#elif defined (G_OS_WIN32)
#ifndef PSAPI_VERSION
#define PSAPI_VERSION 2 // Use the Windows 7 or newer version more directly.
#endif
#include <windows.h>
#include <psapi.h>

View File

@@ -30,6 +30,9 @@
*/
#include <config.h>
#include <glib.h>
#ifndef PSAPI_VERSION
#define PSAPI_VERSION 2 // Use the Windows 7 or newer version more directly.
#endif
#include <windows.h>
#include <psapi.h>
#include <gmodule-win32-internals.h>
@@ -189,3 +192,155 @@ g_module_build_path (const gchar *directory, const gchar *module_name)
}
return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name);
}
// This is not about GModule but is still a close fit.
// This is not named "g_" but that should be ok.
// g_free the result
// No MAX_PATH limit.
//
// Prefer mono_get_module_filename over mono_get_module_filename_ex and mono_get_module_basename.
// Prefer not-ex, not-base.
//
gboolean
mono_get_module_filename (gpointer mod, gunichar2 **pstr, guint32 *plength)
{
gunichar2 *str = NULL;
guint32 capacity = MAX_PATH; // tunable
guint32 length = 0;
gboolean success = FALSE;
while (TRUE)
{
length = 0;
if (capacity > (1 << 24))
break;
str = g_new (gunichar2, capacity);
if (!str)
break;
length = GetModuleFileNameW ((HMODULE)mod, str, capacity);
success = length && length < (capacity - 1); // This function does not truncate, but - 1 anyway.
if (success)
break;
g_free (str); // error or too small
str = NULL;
if (!length) // error
break;
capacity *= 2;
}
*pstr = str;
*plength = length;
return success;
}
// This is not about GModule but is still a close fit.
// This is not named "g_" but that should be ok.
// g_free the result
// No MAX_PATH limit.
//
// Prefer mono_get_module_filename over mono_get_module_filename_ex and mono_get_module_basename.
// Prefer not-ex, not-base.
//
gboolean
mono_get_module_filename_ex (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength)
{
gunichar2 *str = NULL;
guint32 capacity = MAX_PATH; // tunable
guint32 length = 0;
gboolean success = FALSE;
while (TRUE)
{
length = 0;
if (capacity > (1 << 24))
break;
str = g_new (gunichar2, capacity);
if (!str)
break;
length = GetModuleFileNameExW (process, (HMODULE)mod, str, capacity);
success = length && length < (capacity - 1); // This function truncates, thus the - 1.
if (success)
break;
g_free (str); // error or too small
str = NULL;
if (!length) // error
break;
capacity *= 2;
}
*pstr = str;
*plength = length;
return success;
}
// This is not about GModule but is still a close fit.
// This is not named "g_" but that should be ok.
// g_free the result
// No MAX_PATH limit.
//
// Prefer mono_get_module_filename over mono_get_module_filename_ex and mono_get_module_basename.
// Prefer not-ex, not-base.
//
gboolean
mono_get_module_basename (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength)
{
gunichar2 *str = NULL;
guint32 capacity = MAX_PATH; // tunable
guint32 length = 0;
gboolean success = FALSE;
while (TRUE)
{
length = 0;
if (capacity > (1 << 24))
break;
str = g_new (gunichar2, capacity);
if (!str)
break;
length = GetModuleBaseNameW (process, (HMODULE)mod, str, capacity);
success = length && length < (capacity - 1); // This function truncates, thus the - 1.
if (success)
break;
g_free (str); // error or too small
str = NULL;
if (!length) // error
break;
capacity *= 2;
}
*pstr = str;
*plength = length;
return success;
}
// g_free the result
// No MAX_PATH limit.
gboolean
mono_get_current_directory (gunichar2 **pstr, guint32 *plength)
{
gunichar2 *str = NULL;
guint32 capacity = MAX_PATH; // tunable
guint32 length = 0;
gboolean success = FALSE;
while (TRUE)
{
length = 0;
if (capacity > (1 << 24))
break;
str = g_new (gunichar2, capacity);
if (!str)
break;
// Call in loop, not just twice, in case another thread is changing it.
// Result is transient in currentness and validity (can get deleted or become a file).
length = GetCurrentDirectoryW (capacity, str);
success = length && length < (capacity - 1);
if (success)
break;
g_free (str); // error or too small
str = NULL;
if (!length) // error
break;
capacity *= 2;
}
*pstr = str;
*plength = length;
return success;
}

View File

@@ -265,8 +265,8 @@ g_find_program_in_path (const gchar *program)
if (!hasSuffix) {
listx = 0;
while (suffix_list[listx]) {
program_exe = g_strjoin(NULL,program,suffix_list[listx],NULL);
probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program_exe, NULL);
program_exe = g_strjoin (NULL, program, suffix_list [listx], (const char*)NULL);
probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program_exe, (const char*)NULL);
#ifdef HAVE_ACCESS
if (g_access (probe_path, X_OK) == 0){ /* FIXME: on windows this is just a read permissions test */
g_free (curdir);

View File

@@ -214,7 +214,7 @@ void
g_ptr_array_sort(GPtrArray *array, GCompareFunc compare)
{
g_return_if_fail(array != NULL);
qsort(array->pdata, array->len, sizeof(gpointer), compare);
mono_qsort (array->pdata, array->len, sizeof(gpointer), compare);
}
void

View File

@@ -63,7 +63,7 @@ g_slist_prepend (GSList *list, gpointer data)
* Insert the given data in a new node after the current node.
* Return new node.
*/
static inline GSList *
static GSList *
insert_after (GSList *list, gpointer data)
{
list->next = g_slist_prepend (list->next, data);
@@ -75,7 +75,7 @@ insert_after (GSList *list, gpointer data)
* If the list is empty, or the first node contains 'data', return NULL.
* If no node contains 'data', return the last node.
*/
static inline GSList*
static GSList*
find_prev (GSList *list, gconstpointer data)
{
GSList *prev = NULL;
@@ -89,7 +89,7 @@ find_prev (GSList *list, gconstpointer data)
}
/* like 'find_prev', but searches for node 'link' */
static inline GSList*
static GSList*
find_prev_link (GSList *list, GSList *link)
{
GSList *prev = NULL;

View File

@@ -96,7 +96,7 @@ extern char **environ;
G_END_DECLS
#endif
#ifndef G_OS_WIN32
#if !defined (G_OS_WIN32) && defined (HAVE_FORK) && defined (HAVE_EXECV)
static int
safe_read (int fd, gchar *buffer, gint count, GError **gerror)
{
@@ -135,21 +135,12 @@ read_pipes (int outfd, gchar **out_str, int errfd, gchar **err_str, GError **ger
if (out_closed && err_closed)
break;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4389)
#endif
FD_ZERO (&rfds);
if (!out_closed && outfd >= 0)
FD_SET (outfd, &rfds);
if (!err_closed && errfd >= 0)
FD_SET (errfd, &rfds);
#ifdef _MSC_VER
#pragma warning(pop)
#endif
res = select (MAX (outfd, errfd) + 1, &rfds, NULL, NULL, NULL);
if (res > 0) {
if (buffer == NULL)
@@ -203,7 +194,6 @@ create_pipe (int *fds, GError **gerror)
}
return TRUE;
}
#endif /* G_OS_WIN32 */
static int
write_all (int fd, const void *vbuf, size_t n)
@@ -225,6 +215,7 @@ write_all (int fd, const void *vbuf, size_t n)
return nwritten;
}
#endif /* !defined (G_OS_WIN32) && defined (HAVE_FORK) && defined (HAVE_EXECV) */
#if !defined(G_OS_WIN32) && defined(HAVE_GETDTABLESIZE)
int
@@ -257,6 +248,7 @@ g_spawn_command_line_sync (const gchar *command_line,
GError **gerror)
{
#ifdef G_OS_WIN32
return TRUE;
#elif !defined (HAVE_FORK) || !defined (HAVE_EXECV)
fprintf (stderr, "g_spawn_command_line_sync not supported on this platform\n");
return FALSE;
@@ -334,8 +326,8 @@ g_spawn_command_line_sync (const gchar *command_line,
if (WIFEXITED (status) && exit_status) {
*exit_status = WEXITSTATUS (status);
}
#endif
return TRUE;
#endif
}
/*
@@ -356,6 +348,7 @@ g_spawn_async_with_pipes (const gchar *working_directory,
GError **gerror)
{
#ifdef G_OS_WIN32
return TRUE;
#elif !defined (HAVE_FORK) || !defined (HAVE_EXECVE)
fprintf (stderr, "g_spawn_async_with_pipes is not supported on this platform\n");
return FALSE;
@@ -528,8 +521,6 @@ g_spawn_async_with_pipes (const gchar *working_directory,
*standard_output = out_pipe [0];
if (standard_error)
*standard_error = err_pipe [0];
#endif
return TRUE;
#endif
}

View File

@@ -821,11 +821,20 @@ g_ascii_tolower (gchar c)
return c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c;
}
void
g_ascii_strdown_no_alloc (char* dst, const char* src, gsize len)
{
// dst can equal src. no_alloc means this function does no
// allocation; caller may very well.
for (gsize i = 0; i < len; ++i)
dst [i] = g_ascii_tolower (src [i]);
}
gchar *
g_ascii_strdown (const gchar *str, gssize len)
{
char *ret;
int i;
g_return_val_if_fail (str != NULL, NULL);
@@ -833,9 +842,8 @@ g_ascii_strdown (const gchar *str, gssize len)
len = strlen (str);
ret = g_malloc (len + 1);
for (i = 0; i < len; i++)
ret [i] = (guchar) g_ascii_tolower (str [i]);
ret [i] = 0;
g_ascii_strdown_no_alloc (ret, str, len);
ret [len] = 0;
return ret;
}
@@ -859,26 +867,50 @@ g_ascii_strup (const gchar *str, gssize len)
ret = g_malloc (len + 1);
for (i = 0; i < len; i++)
ret [i] = (guchar) g_ascii_toupper (str [i]);
ret [i] = g_ascii_toupper (str [i]);
ret [i] = 0;
return ret;
}
static
int
g_ascii_charcmp (char c1, char c2)
{
// Do not subtract, to avoid overflow.
// Use unsigned to mimic strcmp, and so
// shorter strings compare as less.
const guchar u1 = (guchar)c1;
const guchar u2 = (guchar)c2;
return (u1 < u2) ? -1 : (u1 > u2) ? 1 : 0;
}
static
int
g_ascii_charcasecmp (char c1, char c2)
{
return g_ascii_charcmp (g_ascii_tolower (c1), g_ascii_tolower (c2));
}
gint
g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n)
{
// Unlike strncmp etc. this function does not stop at nul,
// unless there is a mismatch.
if (s1 == s2)
return 0;
gsize i;
g_return_val_if_fail (s1 != NULL, 0);
g_return_val_if_fail (s2 != NULL, 0);
for (i = 0; i < n; i++) {
gchar c1 = g_ascii_tolower (*s1++);
gchar c2 = g_ascii_tolower (*s2++);
if (c1 != c2)
return c1 - c2;
const int j = g_ascii_charcasecmp (*s1++, *s2++);
if (j)
return j;
}
return 0;
@@ -887,21 +919,22 @@ g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n)
gint
g_ascii_strcasecmp (const gchar *s1, const gchar *s2)
{
const char *sp1 = s1;
const char *sp2 = s2;
if (s1 == s2)
return 0;
g_return_val_if_fail (s1 != NULL, 0);
g_return_val_if_fail (s2 != NULL, 0);
while (*sp1 != '\0') {
char c1 = g_ascii_tolower (*sp1++);
char c2 = g_ascii_tolower (*sp2++);
if (c1 != c2)
return c1 - c2;
char c1;
while ((c1 = *s1)) {
++s1;
const int j = g_ascii_charcasecmp (c1, *s2++);
if (j)
return j;
}
return (*sp1) - (*sp2);
return g_ascii_charcmp (0, *s2);
}
gboolean

View File

@@ -41,15 +41,24 @@ CXXFLAGS += $(GLIB_TEST_FLAGS_COMMON) @CXXFLAGS_COMMON@
test_eglib_LDADD = ../libeglib.la $(LTLIBICONV)
assertf_LDADD = ../libeglib.la $(LTLIBICONV)
# Something amiss with subdirs ordering?
../libeglib.la: ../goutput.c # etc
$(MAKE) -C .. $(@F)
abs_srcdir = $(abspath $(srcdir))
run-eglib: all
srcdir=`readlink -f $(srcdir)` ./test-eglib
if DISABLE_EXECUTABLES
run-eglib:
else
# FIXME: Various unit tests are broken on Win32, see https://github.com/mono/mono/issues/16576
if HOST_WIN32
run-eglib:
else
run-eglib:
srcdir="$(abs_srcdir)" ./test-eglib
noinst_PROGRAMS = test-eglib assertf
endif # !HOST_WIN32
endif # DISABLE_EXECUTABLES
run-both: run-eglib
check-local: run-both
MAINTAINERCLEANFILES = Makefile.in

View File

@@ -89,7 +89,8 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
noinst_PROGRAMS = test-eglib$(EXEEXT) assertf$(EXEEXT)
@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@noinst_PROGRAMS = test-eglib$(EXEEXT) \
@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@ assertf$(EXEEXT)
subdir = mono/eglib/test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \
@@ -285,6 +286,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERP_CFLAGS = @INTERP_CFLAGS@
INTL = @INTL@
INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@
JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@
@@ -394,7 +396,7 @@ XINERAMA = @XINERAMA@
XMKMF = @XMKMF@
ZLIB_CFLAGS = @ZLIB_CFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_srcdir = $(abspath $(srcdir))
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
@@ -597,49 +599,43 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.lo:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
@@ -735,6 +731,7 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
@@ -848,11 +845,11 @@ test-bundle-am: test-bundle-local
uninstall-am:
.MAKE: install-am install-strip
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \
clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
@@ -868,15 +865,16 @@ uninstall-am:
.PRECIOUS: Makefile
# Something amiss with subdirs ordering?
../libeglib.la: ../goutput.c # etc
$(MAKE) -C .. $(@F)
run-eglib: all
srcdir=`readlink -f $(srcdir)` ./test-eglib
@DISABLE_EXECUTABLES_TRUE@run-eglib:
# FIXME: Various unit tests are broken on Win32, see https://github.com/mono/mono/issues/16576
@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_TRUE@run-eglib:
@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@run-eglib:
@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@ srcdir="$(abs_srcdir)" ./test-eglib
run-both: run-eglib
check-local: run-both
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -174,7 +174,7 @@ test_file (void)
return FAILED ("3 %s should not be a symlink", path);
#ifndef G_OS_WIN32 /* FIXME */
sympath = g_strconcat (path, "-link", NULL);
sympath = g_strconcat (path, "-link", (const char*)NULL);
ignored = symlink (path, sympath);
res = g_file_test (sympath, G_FILE_TEST_EXISTS);
if (!res)

View File

@@ -14,6 +14,15 @@
#define EXTERNAL_SYMBOL "system"
#endif
#if _WIN32
#ifndef PSAPI_VERSION
#define PSAPI_VERSION 2 // Use the Windows 7 or newer version more directly.
#endif
#include <windows.h>
#include <wchar.h>
#include <psapi.h>
#endif
void G_MODULE_EXPORT
dummy_test_export (void);
@@ -57,8 +66,100 @@ test_module_symbol_null (void)
return OK;
}
static RESULT
test_module_get_module_filename (void)
{
#if _WIN32
const HMODULE mods [ ] = {NULL, LoadLibraryW (L"msvcrt.dll"), (HMODULE)(gssize)-1 };
for (int i = 0; i < G_N_ELEMENTS (mods); ++i) {
const HMODULE mod = mods [i];
for (int j = 0; j <= 2; ++j) {
wchar_t* str = { 0 };
guint32 length = { 0 };
wchar_t buf2 [999] = { 0 };
wchar_t buf3 [2] = { 0 };
gboolean success = { 0 };
guint32 length2 = { 0 };
gboolean success2 = { 0 };
guint32 length3 = { 0 };
gboolean success3 = { 0 };
switch (j) {
case 0:
success = mono_get_module_filename (mod, &str, &length);
length2 = GetModuleFileNameW (mod, buf2, G_N_ELEMENTS (buf2)); // large buf
length3 = GetModuleFileNameW (mod, buf3, 1); // small buf
break;
case 1:
success = mono_get_module_filename_ex (GetCurrentProcess (), mods [i], &str, &length);
length2 = GetModuleFileNameExW (GetCurrentProcess (), mod, buf2, G_N_ELEMENTS (buf2)); // large buf
length3 = GetModuleFileNameExW (GetCurrentProcess (), mod, buf3, 1); // small buf
break;
case 2:
success = mono_get_module_basename (GetCurrentProcess (), mod, &str, &length);
length2 = GetModuleBaseNameW (GetCurrentProcess (), mod, buf2, G_N_ELEMENTS (buf2)); // large buf
length3 = GetModuleBaseNameW (GetCurrentProcess (), mod, buf3, 1); // small buf
break;
}
success2 = length2 && length2 < G_N_ELEMENTS (buf2);
success3 = length3 == 1;
printf ("j:%d s:%X s2:%X s3:%X l:%u l2:%u l3:%u str:%X b2:%X b3:%X\n",
j,
success, success2, success3,
length, length2, length3,
str ? str [0] : 0, buf2 [0], buf3 [0]);
g_assert (success == success2);
g_assert (success == success3 || j > 0);
g_assert (!success || str [0] == buf2 [0]);
//g_assert (!success || str [0] == buf3 [0]);
g_assert (length3 == 0 || length3 == 1);
g_assert (length == (success2 ? wcslen (buf2) :0));
g_assert (!success || !wcscmp (str, buf2));
g_assert (!success || str);
if (success)
printf ("%p %ls %ls %d %d\n", mod, str, buf2, length, length2);
else
printf ("!%p %u\n", str, (guint)length);
g_free (str);
}
}
#endif
return OK;
}
static RESULT
test_get_current_directory (void)
{
#if _WIN32
wchar_t* str = { 0 };
guint32 length = { 0 };
gboolean success = mono_get_current_directory (&str, &length);
wchar_t buf2 [999] = { 0 };
const int length2 = GetCurrentDirectoryW (G_N_ELEMENTS (buf2), buf2);
const gboolean success2 = length2 && length2 < G_N_ELEMENTS (buf2);
wchar_t buf3 [2] = { 0 };
const int length3 = GetCurrentDirectoryW (G_N_ELEMENTS (buf3), buf3);
const gboolean success3 = length3 > 0;
printf ("s:%X s2:%X s3:%X str:%X b2:%X b3:%X\n", success, success2, success3, str ? str [0] : 0, buf2 [0], buf3 [0]);
g_assert (length == length2);
g_assert (success == success2);
g_assert (success == success3);
g_assert (!success || !wcscmp (str, buf2));
g_assert (!success || str);
if (success)
printf ("%ls\n%ls\n", str, buf2);
else
printf ("!%p %u\n", str, (guint)length);
g_free (str);
#endif
return OK;
}
static Test module_tests [] = {
{"g_module_symbol_null", test_module_symbol_null},
{"module_get_module_filename", test_module_get_module_filename},
{"get_current_directory", test_get_current_directory},
{NULL, NULL}
};

View File

@@ -23,80 +23,80 @@ test_buildpath (void)
const char *buffer = "var/private";
const char *dir = "/";
s = g_build_path ("/", "hola///", "//mundo", NULL);
s = g_build_path ("/", "hola///", "//mundo", (const char*)NULL);
if (strcmp (s, "hola/mundo") != 0)
return FAILED ("1 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("/", "hola/", "/mundo", NULL);
s = g_build_path ("/", "hola/", "/mundo", (const char*)NULL);
if (strcmp (s, "hola/mundo") != 0)
return FAILED ("2 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("/", "hola/", "mundo", NULL);
s = g_build_path ("/", "hola/", "mundo", (const char*)NULL);
if (strcmp (s, "hola/mundo") != 0)
return FAILED ("3 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("/", "hola", "/mundo", NULL);
s = g_build_path ("/", "hola", "/mundo", (const char*)NULL);
if (strcmp (s, "hola/mundo") != 0)
return FAILED ("4 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("/", "/hello", "world/", NULL);
s = g_build_path ("/", "/hello", "world/", (const char*)NULL);
if (strcmp (s, "/hello/world/") != 0)
return FAILED ("5 Got wrong result, got: %s", s);
g_free (s);
/* Now test multi-char-separators */
s = g_build_path ("**", "hello", "world", NULL);
s = g_build_path ("**", "hello", "world", (const char*)NULL);
if (strcmp (s, "hello**world") != 0)
return FAILED ("6 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("**", "hello**", "world", NULL);
s = g_build_path ("**", "hello**", "world", (const char*)NULL);
if (strcmp (s, "hello**world") != 0)
return FAILED ("7 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("**", "hello**", "**world", NULL);
s = g_build_path ("**", "hello**", "**world", (const char*)NULL);
if (strcmp (s, "hello**world") != 0)
return FAILED ("8 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("**", "hello**", "**world", NULL);
s = g_build_path ("**", "hello**", "**world", (const char*)NULL);
if (strcmp (s, "hello**world") != 0)
return FAILED ("9 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("1234567890", "hello", "world", NULL);
s = g_build_path ("1234567890", "hello", "world", (const char*)NULL);
if (strcmp (s, "hello1234567890world") != 0)
return FAILED ("10 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("1234567890", "hello1234567890", "1234567890world", NULL);
s = g_build_path ("1234567890", "hello1234567890", "1234567890world", (const char*)NULL);
if (strcmp (s, "hello1234567890world") != 0)
return FAILED ("11 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("1234567890", "hello12345678901234567890", "1234567890world", NULL);
s = g_build_path ("1234567890", "hello12345678901234567890", "1234567890world", (const char*)NULL);
if (strcmp (s, "hello1234567890world") != 0)
return FAILED ("12 Got wrong result, got: %s", s);
g_free (s);
/* Multiple */
s = g_build_path ("/", "a", "b", "c", "d", NULL);
s = g_build_path ("/", "a", "b", "c", "d", (const char*)NULL);
if (strcmp (s, "a/b/c/d") != 0)
return FAILED ("13 Got wrong result, got: %s", s);
g_free (s);
s = g_build_path ("/", "/a", "", "/c/", NULL);
s = g_build_path ("/", "/a", "", "/c/", (const char*)NULL);
if (strcmp (s, "/a/c/") != 0)
return FAILED ("14 Got wrong result, got: %s", s);
g_free (s);
/* Null */
s = g_build_path ("/", NULL, NULL);
s = g_build_path ("/", NULL, (const char*)NULL);
if (s == NULL)
return FAILED ("must get a non-NULL return");
if (s [0] != 0)
@@ -107,7 +107,7 @@ test_buildpath (void)
// and caused all kinds of random errors.
dir = "//";
dir++;
s = g_build_filename (dir, buffer, NULL);
s = g_build_filename (dir, buffer, (const char*)NULL);
if (s [0] != '/')
return FAILED ("Must have a '/' at the start");
@@ -120,7 +120,7 @@ test_buildfname (void)
{
char *s;
s = g_build_filename ("a", "b", "c", "d", NULL);
s = g_build_filename ("a", "b", "c", "d", (const char*)NULL);
#ifdef G_OS_WIN32
if (strcmp (s, "a\\b\\c\\d") != 0)
#else
@@ -130,16 +130,16 @@ test_buildfname (void)
g_free (s);
#ifdef G_OS_WIN32
s = g_build_filename ("C:\\", "a", NULL);
s = g_build_filename ("C:\\", "a", (const char*)NULL);
if (strcmp (s, "C:\\a") != 0)
#else
s = g_build_filename ("/", "a", NULL);
s = g_build_filename ("/", "a", (const char*)NULL);
if (strcmp (s, "/a") != 0)
#endif
return FAILED ("1 Got wrong result, got: %s", s);
#ifndef G_OS_WIN32
s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL);
s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", (const char*)NULL);
if (strcmp (s, "/foo/bar/tolo/meo/") != 0)
return FAILED ("1 Got wrong result, got: %s", s);
#endif

Some files were not shown because too many files have changed in this diff Show More