Imported Upstream version 5.20.0.180

Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:11:37 +00:00
parent 0e2d47d1c8
commit 0510252385
3360 changed files with 83827 additions and 39243 deletions

View File

@@ -3,6 +3,8 @@ include $(top_srcdir)/mk/common.mk
# FIXME
#SUBDIRS = test
DIST_SUBDIRS = test
noinst_LTLIBRARIES = libeglib.la
AM_CFLAGS = $(WERROR_CFLAGS)
@@ -53,6 +55,8 @@ libeglib_la_SOURCES = \
unicode-data.h \
$(os_files)
CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@
eglibdir=$(datadir)/mono-$(API_VER)/mono/eglib
eglib_DATA = eglib-config.h

View File

@@ -84,8 +84,10 @@ DIST_COMMON = $(top_srcdir)/mk/common.mk $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs \
$(srcdir)/eglib-config.h.in $(top_srcdir)/depcomp
subdir = mono/eglib
SUBDIRS =
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
@@ -170,6 +172,14 @@ am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libeglib_la_SOURCES)
DIST_SOURCES = $(am__libeglib_la_SOURCES_DIST)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -204,6 +214,14 @@ am__uninstall_files_from_dir = { \
}
am__installdirs = "$(DESTDIR)$(eglibdir)"
DATA = $(eglib_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -224,6 +242,31 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -250,7 +293,7 @@ CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
CMAKE = @CMAKE@
CPP = @CPP@
@@ -260,6 +303,7 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CXXFLAGS_COMMON = @CXXFLAGS_COMMON@
CXX_ADD_CFLAGS = @CXX_ADD_CFLAGS@
CXX_REMOVE_CFLAGS = @CXX_REMOVE_CFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -333,6 +377,22 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
MONO_JEMALLOC_ASSERT = @MONO_JEMALLOC_ASSERT@
MONO_JEMALLOC_DEFAULT = @MONO_JEMALLOC_DEFAULT@
MONO_JEMALLOC_ENABLED = @MONO_JEMALLOC_ENABLED@
MONO_NATIVE_CC = @MONO_NATIVE_CC@
MONO_NATIVE_CFLAGS = @MONO_NATIVE_CFLAGS@
MONO_NATIVE_COMPAT_CFLAGS = @MONO_NATIVE_COMPAT_CFLAGS@
MONO_NATIVE_COMPAT_LDFLAGS = @MONO_NATIVE_COMPAT_LDFLAGS@
MONO_NATIVE_CPPFLAGS = @MONO_NATIVE_CPPFLAGS@
MONO_NATIVE_CXX = @MONO_NATIVE_CXX@
MONO_NATIVE_CXXFLAGS = @MONO_NATIVE_CXXFLAGS@
MONO_NATIVE_LDFLAGS = @MONO_NATIVE_LDFLAGS@
MONO_NATIVE_LIBADD = @MONO_NATIVE_LIBADD@
MONO_NATIVE_LIBRARY_NAME = @MONO_NATIVE_LIBRARY_NAME@
MONO_NATIVE_PLATFORM = @MONO_NATIVE_PLATFORM@
MONO_NATIVE_PLATFORM_TYPE = @MONO_NATIVE_PLATFORM_TYPE@
MONO_NATIVE_PLATFORM_TYPE_COMPAT = @MONO_NATIVE_PLATFORM_TYPE_COMPAT@
MONO_NATIVE_PLATFORM_TYPE_UNIFIED = @MONO_NATIVE_PLATFORM_TYPE_UNIFIED@
MONO_NATIVE_UNIFIED_CFLAGS = @MONO_NATIVE_UNIFIED_CFLAGS@
MONO_NATIVE_UNIFIED_LDFLAGS = @MONO_NATIVE_UNIFIED_LDFLAGS@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -459,6 +519,7 @@ MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
# FIXME
#SUBDIRS = test
DIST_SUBDIRS = test
noinst_LTLIBRARIES = libeglib.la
AM_CFLAGS = $(WERROR_CFLAGS)
win_files = \
@@ -512,7 +573,7 @@ AM_CPPFLAGS = -I$(srcdir)
@HOST_ANDROID_TRUE@libeglib_la_LIBADD = -lm -llog
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
all: all-am
all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
@@ -910,14 +971,61 @@ uninstall-eglibDATA:
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(eglibdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
@@ -930,7 +1038,7 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$$unique; \
fi; \
fi
ctags: ctags-am
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
@@ -943,7 +1051,7 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
@@ -992,22 +1100,48 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(eglibdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
@@ -1030,89 +1164,90 @@ 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)
clean: clean-am
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi: dvi-recursive
dvi-am:
html: html-am
html: html-recursive
html-am:
info: info-am
info: info-recursive
info-am:
install-data-am: install-eglibDATA
install-dvi: install-dvi-am
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html: install-html-recursive
install-html-am:
install-info: install-info-am
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-am
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf: pdf-recursive
pdf-am:
ps: ps-am
ps: ps-recursive
ps-am:
uninstall-am: uninstall-eglibDATA
.MAKE: install-am install-strip
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool 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 install install-am install-data \
install-data-am install-dvi install-dvi-am install-eglibDATA \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool \
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 \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-eglibDATA install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-eglibDATA

View File

@@ -45,8 +45,10 @@ typedef int pid_t;
#define F_SETFD 1
#define FD_CLOEXEC 1
#ifndef __cplusplus
#undef inline
#define inline __inline
#endif
#define strtok_r strtok_s

View File

@@ -1,3 +1,11 @@
#undef g_malloc
#undef g_realloc
#undef g_malloc0
#undef g_calloc
#undef g_try_malloc
#undef g_try_realloc
#undef g_memdup
#define g_array_append monoeg_g_array_append
#define g_array_append_vals monoeg_g_array_append_vals
#define g_array_free monoeg_g_array_free
@@ -285,9 +293,7 @@
#define g_unichar_break_type monoeg_unichar_break_type
#define g_unichar_isspace monoeg_unichar_isspace
#define g_unichar_to_utf16 monoeg_unichar_to_utf16
#define g_utf8_find_prev_char monoeg_utf8_find_prev_char
#define g_utf8_get_char_validated monoeg_utf8_get_char_validated
#define g_utf8_prev_char monoeg_utf8_prev_char
#define g_utf8_to_ucs4 monoeg_utf8_to_ucs4
@@ -295,3 +301,5 @@
#define g_log_set_default_handler monoeg_log_set_default_handler
#define g_set_print_handler monoeg_set_print_handler
#define g_set_printerr_handler monoeg_set_printerr_handler
#define g_size_to_int monoeg_size_to_int

View File

@@ -25,7 +25,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <stdlib.h>
#include <glib.h>

View File

@@ -25,12 +25,12 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <stdlib.h>
#include <glib.h>
GByteArray *
g_byte_array_new ()
g_byte_array_new (void)
{
return (GByteArray *) g_array_new (FALSE, TRUE, 1);
}

View File

@@ -25,6 +25,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <stdio.h>
#include <glib.h>
#include <time.h>

View File

@@ -25,6 +25,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <stdio.h>
#include <glib.h>

View File

@@ -25,6 +25,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>

View File

@@ -25,6 +25,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
@@ -54,7 +55,7 @@ g_dir_open (const gchar *path, guint flags, GError **gerror)
dir = g_new0 (GDir, 1);
path_utf16 = u8to16 (path);
path_utf16_search = g_malloc ((wcslen((wchar_t *) path_utf16) + 3)*sizeof(gunichar2));
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
wcscpy (path_utf16_search, path_utf16);
wcscat (path_utf16_search, L"\\*");
@@ -72,7 +73,7 @@ g_dir_open (const gchar *path, guint flags, GError **gerror)
g_free (path_utf16_search);
g_free (path_utf16);
while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0)) {
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
if (!FindNextFileW (dir->handle, &find_data)) {
if (gerror) {
gint err = errno;
@@ -111,7 +112,7 @@ g_dir_read_name (GDir *dir)
dir->next = NULL;
return dir->current;
}
} while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0));
} while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0));
dir->next = u16to8 (find_data.cFileName);
return dir->current;

View File

@@ -80,7 +80,7 @@ g_file_test (const gchar *filename, GFileTest test)
}
gchar *
g_mkdtemp (char *tmp_template)
g_mkdtemp (char *temp)
{
/*
* On systems without mkdtemp, use a reimplemented version
@@ -90,21 +90,14 @@ g_mkdtemp (char *tmp_template)
* present without redefining it.
*/
#if defined(HAVE_MKDTEMP) && !defined(_AIX)
char *template_copy = g_strdup (tmp_template);
return mkdtemp (template_copy);
return mkdtemp (g_strdup (temp));
#else
char *template = g_strdup (tmp_template);
temp = mktemp (g_strdup (temp));
/* 0700 is the mode specified in specs */
if (temp && *temp && mkdir (temp, 0700) == 0)
return temp;
template = mktemp(template);
if (template && *template) {
/* 0700 is the mode specified in specs */
if (mkdir (template, 0700) == 0){
return template;
}
}
g_free (template);
g_free (temp);
return NULL;
#endif
}

View File

@@ -25,9 +25,11 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <stdio.h>
#include <math.h>
#include <glib.h>
#include <eglib-remap.h> // Remove the cast macros and restore the rename macros.
typedef struct _Slot Slot;
@@ -656,7 +658,7 @@ g_int_hash (gconstpointer v1)
gboolean
g_str_equal (gconstpointer v1, gconstpointer v2)
{
return strcmp (v1, v2) == 0;
return strcmp ((const char*)v1, (const char*)v2) == 0;
}
guint

View File

@@ -22,11 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <glib.h>
#include <string.h>
#ifdef HAVE_ICONV_H
@@ -51,7 +47,7 @@ struct _GIConv {
Decoder decode;
Encoder encode;
gunichar c;
#ifdef HAVE_ICONV
#ifdef HAVE_LIBICONV
iconv_t cd;
#endif
};
@@ -112,7 +108,7 @@ static struct {
GIConv
g_iconv_open (const char *to_charset, const char *from_charset)
{
#ifdef HAVE_ICONV
#ifdef HAVE_LIBICONV
iconv_t icd = (iconv_t) -1;
#endif
Decoder decoder = NULL;
@@ -135,7 +131,7 @@ g_iconv_open (const char *to_charset, const char *from_charset)
}
if (!encoder || !decoder) {
#ifdef HAVE_ICONV
#ifdef HAVE_LIBICONV
if ((icd = iconv_open (to_charset, from_charset)) == (iconv_t) -1)
return (GIConv) -1;
#else
@@ -150,7 +146,7 @@ g_iconv_open (const char *to_charset, const char *from_charset)
cd->encode = encoder;
cd->c = -1;
#ifdef HAVE_ICONV
#ifdef HAVE_LIBICONV
cd->cd = icd;
#endif
@@ -160,7 +156,7 @@ g_iconv_open (const char *to_charset, const char *from_charset)
int
g_iconv_close (GIConv cd)
{
#ifdef HAVE_ICONV
#ifdef HAVE_LIBICONV
if (cd->cd != (iconv_t) -1)
iconv_close (cd->cd);
#endif
@@ -179,7 +175,7 @@ g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft,
gunichar c;
int rc = 0;
#ifdef HAVE_ICONV
#ifdef HAVE_LIBICONV
if (cd->cd != (iconv_t) -1) {
/* Note: gsize may have a different size than size_t, so we need to
remap inbytesleft and outbytesleft to size_t's. */

View File

@@ -1,5 +1,22 @@
#ifndef __GLIB_H
#define __GLIB_H
// Ask stdint.h and inttypes.h for the full C99 features for CentOS 6 g++ 4.4, Android, etc.
// See for example:
// $HOME/android-toolchain/toolchains/armeabi-v7a-clang/sysroot/usr/include/inttypes.h
// $HOME/android-toolchain/toolchains/armeabi-v7a-clang/sysroot/usr/include/stdint.h
#ifdef __cplusplus
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#endif // __cplusplus
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@@ -7,16 +24,13 @@
#include <stddef.h>
#include <ctype.h>
#include <limits.h>
#ifdef _MSC_VER
#pragma include_alias(<eglib-config.h>, <eglib-config.hw>)
#endif
#include <stdint.h>
#include <inttypes.h>
#ifdef _MSC_VER
#include <eglib-config.hw>
#else
#include <eglib-config.h>
#endif
// - Pointers should only be converted to or from pointer-sized integers.
// - Any size integer can be converted to any other size integer.
@@ -48,14 +62,110 @@
# define offsetof(s_name,n_name) (size_t)(char *)&(((s_name*)0)->m_name)
#endif
#define __EGLIB_X11 1
#ifdef __cplusplus
#define G_BEGIN_DECLS extern "C" {
#define G_END_DECLS }
#define G_EXTERN_C extern "C"
#else
#define G_BEGIN_DECLS
#define G_END_DECLS
#define G_BEGIN_DECLS /* nothing */
#define G_END_DECLS /* nothing */
#define G_EXTERN_C /* nothing */
#endif
#ifdef __cplusplus
#define g_cast monoeg_g_cast // in case not inlined (see eglib-remap.h)
// g_cast converts void* to T*.
// e.g. #define malloc(x) (g_cast (malloc (x)))
// FIXME It used to do more. Rename?
struct g_cast
{
private:
void * const x;
public:
explicit g_cast (void *y) : x(y) { }
// Lack of rvalue constructor inhibits ternary operator.
// Either don't use ternary, or cast each side.
// sa = (salen <= 128) ? g_alloca (salen) : g_malloc (salen);
// w32socket.c:1045:24: error: call to deleted constructor of 'monoeg_g_cast'
//g_cast (g_cast&& y) : x(y.x) { }
g_cast (g_cast&&) = delete;
g_cast () = delete;
g_cast (const g_cast&) = delete;
template <typename TTo>
operator TTo* () const
{
return (TTo*)x;
}
};
#else
// FIXME? Parens are omitted to preserve prior meaning.
#define g_cast(x) x
#endif
#ifdef __cplusplus
// G++4.4 breaks opeq below without this.
#if defined (__GNUC__) || defined (__clang__)
#define G_MAY_ALIAS __attribute__((__may_alias__))
#else
#define G_MAY_ALIAS /* nothing */
#endif
// Provide for bit operations on enums, but not all integer operations.
// This alleviates a fair number of casts in porting C to C++.
// Forward declare template with no generic implementation.
template <size_t> struct g_size_to_int;
// Template specializations.
template <> struct g_size_to_int<1> { typedef int8_t type; };
template <> struct g_size_to_int<2> { typedef int16_t type; };
template <> struct g_size_to_int<4> { typedef int32_t type; };
template <> struct g_size_to_int<8> { typedef int64_t type; };
// g++4.4 does not accept:
//template <typename T>
//using g_size_to_int_t = typename g_size_to_int <sizeof (T)>::type;
#define g_size_to_int_t(x) g_size_to_int <sizeof (x)>::type
#define G_ENUM_BINOP(Enum, op, opeq) \
inline Enum \
operator op (Enum a, Enum b) \
{ \
typedef g_size_to_int_t (Enum) type; \
return static_cast<Enum>(static_cast<type>(a) op b); \
} \
\
inline Enum& \
operator opeq (Enum& a, Enum b) \
{ \
typedef g_size_to_int_t (Enum) G_MAY_ALIAS type; \
return (Enum&)((type&)a opeq b); \
} \
#define G_ENUM_FUNCTIONS(Enum) \
extern "C++" { /* in case within extern "C" */ \
inline Enum \
operator~ (Enum a) \
{ \
typedef g_size_to_int_t (Enum) type; \
return static_cast<Enum>(~static_cast<type>(a)); \
} \
\
G_ENUM_BINOP (Enum, |, |=) \
G_ENUM_BINOP (Enum, &, &=) \
G_ENUM_BINOP (Enum, ^, ^=) \
\
} /* extern "C++" */
#else
#define G_ENUM_FUNCTIONS(Enum) /* nothing */
#endif
G_BEGIN_DECLS
@@ -87,7 +197,14 @@ typedef float gfloat;
typedef double gdouble;
typedef int32_t gboolean;
#if defined (HOST_WIN32) || defined (_WIN32)
G_END_DECLS
#include <wchar.h>
typedef wchar_t gunichar2;
G_BEGIN_DECLS
#else
typedef guint16 gunichar2;
#endif
typedef guint32 gunichar;
/*
@@ -151,10 +268,15 @@ typedef guint32 gunichar;
/*
* Allocation
*/
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
void g_free (void *ptr);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
gpointer g_realloc (gpointer obj, gsize size);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
gpointer g_malloc (gsize x);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
gpointer g_malloc0 (gsize x);
G_EXTERN_C // Used by profilers, at least.
gpointer g_calloc (gsize n, gsize x);
gpointer g_try_malloc (gsize x);
gpointer g_try_realloc (gpointer obj, gsize size);
@@ -164,9 +286,10 @@ gpointer g_try_realloc (gpointer obj, gsize size);
#define g_newa(type,size) ((type *) alloca (sizeof (type) * (size)))
#define g_memmove(dest,src,len) memmove (dest, src, len)
#define g_renew(struct_type, mem, n_structs) g_realloc (mem, sizeof (struct_type) * n_structs)
#define g_alloca(size) alloca (size)
#define g_renew(struct_type, mem, n_structs) ((struct_type*)g_realloc (mem, sizeof (struct_type) * n_structs))
#define g_alloca(size) (g_cast (alloca (size)))
G_EXTERN_C // Used by libtest, at least.
gpointer g_memdup (gconstpointer mem, guint byte_size);
static inline gchar *g_strdup (const gchar *str) { if (str) { return (gchar*) g_memdup (str, (guint)strlen (str) + 1); } return NULL; }
gchar **g_strdupv (gchar **str_array);
@@ -192,7 +315,10 @@ typedef struct _GMemChunk GMemChunk;
gboolean g_hasenv(const gchar *variable);
gchar * g_getenv(const gchar *variable);
G_EXTERN_C // sdks/wasm/driver.c is C and uses this
gboolean g_setenv(const gchar *variable, const gchar *value, gboolean overwrite);
void g_unsetenv(const gchar *variable);
gchar* g_win32_getlocale(void);
@@ -223,6 +349,7 @@ void g_propagate_error (GError **dest, GError *src);
/*
* Strings utility
*/
G_EXTERN_C // Used by libtest, at least.
gchar *g_strdup_printf (const gchar *format, ...);
gchar *g_strdup_vprintf (const gchar *format, va_list args);
gchar *g_strndup (const gchar *str, gsize n);
@@ -243,7 +370,7 @@ gchar *g_strchomp (gchar *str);
void g_strdown (gchar *string);
gchar *g_strnfill (gsize length, gchar fill_char);
gchar *g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter);
void g_strdelimit (char *string, char delimiter, char new_delimiter);
gchar *g_strescape (const gchar *source, const gchar *exceptions);
gchar *g_filename_to_uri (const gchar *filename, const gchar *hostname, GError **gerror);
@@ -290,9 +417,6 @@ gboolean g_utf16_asciiz_equal (const gunichar2 *utf16, const char *ascii);
#endif
#define g_ascii_strdup strdup
#define G_STR_DELIMITERS "_-|> <."
/*
* String type
*/
@@ -452,22 +576,28 @@ struct _GHashTableIter
gpointer dummy [8];
};
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
GHashTable *g_hash_table_new (GHashFunc hash_func, GEqualFunc key_equal_func);
GHashTable *g_hash_table_new_full (GHashFunc hash_func, GEqualFunc key_equal_func,
GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
void g_hash_table_insert_replace (GHashTable *hash, gpointer key, gpointer value, gboolean replace);
guint g_hash_table_size (GHashTable *hash);
GList *g_hash_table_get_keys (GHashTable *hash);
GList *g_hash_table_get_values (GHashTable *hash);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
gpointer g_hash_table_lookup (GHashTable *hash, gconstpointer key);
gboolean g_hash_table_lookup_extended (GHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
void g_hash_table_foreach (GHashTable *hash, GHFunc func, gpointer user_data);
gpointer g_hash_table_find (GHashTable *hash, GHRFunc predicate, gpointer user_data);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
gboolean g_hash_table_remove (GHashTable *hash, gconstpointer key);
gboolean g_hash_table_steal (GHashTable *hash, gconstpointer key);
void g_hash_table_remove_all (GHashTable *hash);
guint g_hash_table_foreach_remove (GHashTable *hash, GHRFunc func, gpointer user_data);
guint g_hash_table_foreach_steal (GHashTable *hash, GHRFunc func, gpointer user_data);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
void g_hash_table_destroy (GHashTable *hash);
void g_hash_table_print_stats (GHashTable *table);
@@ -479,7 +609,9 @@ guint g_spaced_primes_closest (guint x);
#define g_hash_table_insert(h,k,v) g_hash_table_insert_replace ((h),(k),(v),FALSE)
#define g_hash_table_replace(h,k,v) g_hash_table_insert_replace ((h),(k),(v),TRUE)
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
gboolean g_direct_equal (gconstpointer v1, gconstpointer v2);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
guint g_direct_hash (gconstpointer v1);
gboolean g_int_equal (gconstpointer v1, gconstpointer v2);
guint g_int_hash (gconstpointer v1);
@@ -523,6 +655,7 @@ void g_array_set_size (GArray *array, gint length);
#define g_array_append_val(a,v) (g_array_append_vals((a),&(v),1))
#define g_array_insert_val(a,i,v) (g_array_insert_vals((a),(i),&(v),1))
#define g_array_index(a,t,i) *(t*)(((a)->data) + sizeof(t) * (i))
//FIXME previous missing parens
/*
* QSort
@@ -554,6 +687,7 @@ gpointer *g_ptr_array_free (GPtrArray *array, gboolean free_seg);
void g_ptr_array_foreach (GPtrArray *array, GFunc func, gpointer user_data);
guint g_ptr_array_capacity (GPtrArray *array);
#define g_ptr_array_index(array,index) (array)->pdata[(index)]
//FIXME previous missing parens
/*
* Queues
@@ -595,13 +729,17 @@ typedef enum {
G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
} GLogLevelFlags;
G_ENUM_FUNCTIONS (GLogLevelFlags)
void g_printv (const gchar *format, va_list args);
void g_print (const gchar *format, ...);
void g_printerr (const gchar *format, ...);
GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask);
void g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
void g_log (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...);
G_EXTERN_C // Used by MonoPosixHelper or MonoSupportW, at least.
void g_assertion_message (const gchar *format, ...) G_GNUC_NORETURN;
const char * g_get_assertion_message (void);
@@ -800,9 +938,11 @@ gchar *g_utf8_strdown (const gchar *str, gssize len);
gint g_unichar_to_utf8 (gunichar c, gchar *outbuf);
gunichar *g_utf8_to_ucs4_fast (const gchar *str, glong len, glong *items_written);
gunichar *g_utf8_to_ucs4 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
G_EXTERN_C // Used by libtest, at least.
gunichar2 *g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
gunichar2 *eg_utf8_to_utf16_with_nuls (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
gunichar2 *eg_wtf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
G_EXTERN_C // Used by libtest, at least.
gchar *g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err);
gunichar *g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err);
gchar *g_ucs4_to_utf8 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err);
@@ -930,6 +1070,7 @@ typedef enum {
G_FILE_TEST_EXISTS = 1 << 4
} GFileTest;
G_ENUM_FUNCTIONS (GFileTest)
gboolean g_file_set_contents (const gchar *filename, const gchar *contents, gssize length, GError **gerror);
gboolean g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **gerror);
@@ -1116,8 +1257,6 @@ extern const guchar g_utf8_jump_table[256];
gboolean g_utf8_validate (const gchar *str, gssize max_len, const gchar **end);
gunichar g_utf8_get_char_validated (const gchar *str, gssize max_len);
gchar *g_utf8_find_prev_char (const char *str, const char *p);
gchar *g_utf8_prev_char (const char *str);
#define g_utf8_next_char(p) ((p) + g_utf8_jump_table[(guchar)(*p)])
gunichar g_utf8_get_char (const gchar *src);
glong g_utf8_strlen (const gchar *str, gssize max);
@@ -1199,4 +1338,22 @@ glong g_utf8_pointer_to_offset (const gchar *str, const gchar *pos);
G_END_DECLS
#endif
// 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.
// However these are also already macros.
#undef g_malloc
#undef g_realloc
#undef g_malloc0
#undef g_calloc
#undef g_try_malloc
#undef g_try_realloc
#undef g_memdup
#define g_malloc(x) (g_cast (monoeg_malloc (x)))
#define g_realloc(obj, size) (g_cast (monoeg_realloc ((obj), (size))))
#define g_malloc0(x) (g_cast (monoeg_malloc0 (x)))
#define g_calloc(x, y) (g_cast (monoeg_g_calloc ((x), (y))))
#define g_try_malloc(x) (g_cast (monoeg_try_malloc (x)))
#define g_try_realloc(obj, size) (g_cast (monoeg_try_realloc ((obj), (size))))
#define g_memdup(mem, size) (g_cast (monoeg_g_memdup ((mem), (size))))
#endif // __GLIB_H

View File

@@ -26,11 +26,12 @@
*
* (C) 2006 Novell, Inc.
*/
#include "config.h"
#include <stdio.h>
#include <glib.h>
GList*
g_list_alloc ()
g_list_alloc (void)
{
return g_new0 (GList, 1);
}

View File

@@ -39,6 +39,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <glib.h>
@@ -53,13 +54,13 @@ typedef enum {
CLOSING_ELEMENT,
COMMENT,
SKIP_XML_DECLARATION
} ParseState;
} MonoGMarkupParseState;
struct _GMarkupParseContext {
GMarkupParser parser;
gpointer user_data;
GDestroyNotify user_data_dnotify;
ParseState state;
MonoGMarkupParseState state;
/* Stores the name of the current element, so we can issue the end_element */
GSList *level;
@@ -447,7 +448,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
goto fail;
}
text = current->data;
text = (char*)current->data;
if (context->parser.end_element != NULL){
context->parser.end_element (context, text, context->user_data, gerror);
if (gerror != NULL && *gerror != NULL){

View File

@@ -29,6 +29,11 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <eglib-remap.h> // Remove the cast macros and restore the rename macros.
#undef malloc
#undef realloc
#undef free
#undef calloc
#if defined (ENABLE_OVERRIDABLE_ALLOCATORS)
@@ -123,7 +128,7 @@ gpointer g_calloc (gsize n, gsize x)
gpointer ptr;
if (!x || !n)
return 0;
ptr = G_CALLOC_INTERNAL (n, x);
ptr = G_CALLOC_INTERNAL (n, x);
if (ptr)
return ptr;
g_error ("Could not allocate %i (%i * %i) bytes", x*n, n, x);

View File

@@ -133,7 +133,12 @@ g_get_known_folder_path (void)
{
gchar *folder_path = NULL;
PWSTR profile_path = NULL;
HRESULT hr = SHGetKnownFolderPath (&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &profile_path);
#ifdef __cplusplus
REFGUID folderid = FOLDERID_Profile;
#else
REFGUID folderid = &FOLDERID_Profile;
#endif
HRESULT hr = SHGetKnownFolderPath (folderid, KF_FLAG_DEFAULT, NULL, &profile_path);
if (SUCCEEDED(hr)) {
folder_path = u16to8 (profile_path);
CoTaskMemFree (profile_path);
@@ -170,8 +175,8 @@ g_get_home_dir (void)
sprintf (home_dir, "%s%s", drive, path);
}
}
g_free (drive);
g_free (path);
g_free ((void*)drive);
g_free ((void*)path);
}
return home_dir;

View File

@@ -20,9 +20,14 @@ typedef enum {
G_MODULE_BIND_LOCAL = 0x02,
G_MODULE_BIND_MASK = 0x03
} GModuleFlags;
G_ENUM_FUNCTIONS (GModuleFlags)
typedef struct _GModule GModule;
G_EXTERN_C // Used by libtest, at least.
GModule *g_module_open (const gchar *file, GModuleFlags flags);
G_EXTERN_C // Used by libtest, at least.
gboolean g_module_symbol (GModule *module, const gchar *symbol_name,
gpointer *symbol);
const gchar *g_module_error (void);

View File

@@ -97,9 +97,9 @@ strrchr_seperator (const gchar* filename)
#endif
char *p;
p = strrchr (filename, G_DIR_SEPARATOR);
p = (char*)strrchr (filename, G_DIR_SEPARATOR);
#ifdef G_OS_WIN32
p2 = strrchr (filename, '/');
p2 = (char*)strrchr (filename, '/');
if (p2 > p)
p = p2;
#endif
@@ -224,7 +224,7 @@ g_find_program_in_path (const gchar *program)
char *save = NULL;
#ifdef G_OS_WIN32
char *program_exe;
char *suffix_list[5] = {".exe",".cmd",".bat",".com",NULL};
static char const * const suffix_list[5] = {".exe",".cmd",".bat",".com",NULL};
int listx;
gboolean hasSuffix;
#endif

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