After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738659 - Add a getopt() implementation for Visual Studio Builds for GOption
Add a getopt() implementation for Visual Studio Builds for GOption
Status: RESOLVED DUPLICATE of bug 723160
Product: glib
Classification: Platform
Component: general
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-10-17 06:10 UTC by Fan, Chun-wei
Modified: 2014-10-20 12:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib/goption.c: Use adapted gnulib getopt() implementation for MSVC Builds (48.89 KB, patch)
2014-10-17 06:21 UTC, Fan, Chun-wei
rejected Details | Review
GOption: Default to no strict POSIX mode on Windows (2.67 KB, patch)
2014-10-17 11:10 UTC, Fan, Chun-wei
none Details | Review

Description Fan, Chun-wei 2014-10-17 06:10:00 UTC
Hi,

Commit ae52ab3d1170a393b0b734e9b9b37c3f107a7c03 (GOption: add strict posix mode) made use of getopt(), which is unfortunately not available in Visual Studio, therefore the build of GLib would break there.

gnulib does provide a portable getopt() implementation, which can be adapted for use for Visual Studio builds, so I will attach the patch for goption.c to use it in a bit.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2014-10-17 06:21:54 UTC
Created attachment 288719 [details] [review]
glib/goption.c: Use adapted gnulib getopt() implementation for MSVC Builds

Hi,

This makes glib/goption.c make use of the getopt() implementation that is adapted from gnulib's implementation of it on Visual Studio builds.  The parts that are not relevant to MSVC are removed from the code, and this code has been tested against the option-context test program, where the tests pass as-is.

With blessings, thank you!
Comment 2 Allison Karlitskaya (desrt) 2014-10-17 08:59:48 UTC
getopt() is absolutely not required here -- it is only queried to decide what the behaviour of the underlying OS is.

Just pick one way on Windows (probably the old way) and go with it.  This patch is not required.
Comment 3 Allison Karlitskaya (desrt) 2014-10-17 09:01:02 UTC
Review of attachment 288719 [details] [review]:

.
Comment 4 Fan, Chun-wei 2014-10-17 11:10:10 UTC
Created attachment 288743 [details] [review]
GOption: Default to no strict POSIX mode on Windows

Hello Ryan,

Thanks for the notes, so I think that like what you mentioned, this patch turns strict POSIX mode off by default on Windows (as it is not strictly POSIX compliant in the first place).

I have also updated the docs part a bit, so please see whether that part is ok too.

With blessings, thank you!
Comment 5 Allison Karlitskaya (desrt) 2014-10-20 12:36:11 UTC
We fixed this by addressing a related problem in bug 723160.

*** This bug has been marked as a duplicate of bug 723160 ***