Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:hiberis:mingw:win64
mingw64-glib2
glib-2.30.0-Add-g_option_context_parse_command_...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File glib-2.30.0-Add-g_option_context_parse_command_line.patch of Package mingw64-glib2
diff -Naur glib-2.30.0/docs/reference/glib/glib-sections.txt glib-2.30.0.new/docs/reference/glib/glib-sections.txt --- glib-2.30.0/docs/reference/glib/glib-sections.txt 2011-10-04 22:47:10.690036934 +0200 +++ glib-2.30.0.new/docs/reference/glib/glib-sections.txt 2011-10-04 22:47:42.778196039 +0200 @@ -1128,6 +1128,7 @@ g_option_context_set_translate_func g_option_context_set_translation_domain g_option_context_free +g_option_context_parse_command_line g_option_context_parse g_option_context_parse_utf8 g_option_context_set_help_enabled diff -Naur glib-2.30.0/glib/glib.symbols glib-2.30.0.new/glib/glib.symbols --- glib-2.30.0/glib/glib.symbols 2011-10-04 22:47:10.694036940 +0200 +++ glib-2.30.0.new/glib/glib.symbols 2011-10-04 22:50:18.002965766 +0200 @@ -749,6 +749,7 @@ g_option_context_get_main_group g_option_context_get_summary g_option_context_new +g_option_context_parse_command_line g_option_context_parse g_option_context_parse_utf8 g_option_context_set_description diff -Naur glib-2.30.0/glib/goption.c glib-2.30.0.new/glib/goption.c --- glib-2.30.0/glib/goption.c 2011-10-04 22:47:10.698036953 +0200 +++ glib-2.30.0.new/glib/goption.c 2011-10-04 22:47:42.782196059 +0200 @@ -2119,6 +2119,58 @@ return option_context_parse_internal (context, TRUE, argc, argv, error); } +#ifndef G_OS_WIN32 +static +void getmainargs(int *argc, + char ***argv) +{ + extern char **environ; + char ***argvp; + void *p; + + asm ("mov %%esp, %0" : "=r" (p)); + argvp = p; + while (*argvp != environ) { + argvp++; + } + argvp--; + *argv = *argvp; + argvp--; + *argc = (int) *argvp; +} +#endif + +gboolean +g_option_context_parse_command_line (GOptionContext *context, GError **error) +{ +#ifdef G_OS_WIN32 + gboolean r; + int i, argc; + gchar **argv, **argv_tmp; + + argv = g_win32_get_utf8_argv(TRUE, &argc); + + argv_tmp = g_new (gchar *, argc + 1); + for (i = 0; i < argc; i++) + argv_tmp[i] = argv[i]; + argv_tmp[argc] = NULL; + + r = g_option_context_parse_utf8 (context, &argc, &argv_tmp, error); + + g_strfreev (argv); + g_free (argv_tmp); + + return r; +#else + int argc; + char **argv; + + getmainargs(&argc, &argv); + + return g_option_context_parse (context, &argc, &argv, error); +#endif +} + /** * g_option_group_new: * @name: the name for the option group, this is used to provide diff -Naur glib-2.30.0/glib/goption.h glib-2.30.0.new/glib/goption.h --- glib-2.30.0/glib/goption.h 2011-10-04 22:47:10.698036953 +0200 +++ glib-2.30.0.new/glib/goption.h 2011-10-04 22:47:42.782196059 +0200 @@ -333,7 +333,8 @@ gint *argc, gchar ***argv, GError **error); - +gboolean g_option_context_parse_command_line (GOptionContext *context, + GError **error); void g_option_context_set_translate_func (GOptionContext *context, GTranslateFunc func, gpointer data,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor