GNOME Bugzilla – Bug 738659
Add a getopt() implementation for Visual Studio Builds for GOption
Last modified: 2014-10-20 12:36:11 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!
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!
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.
Review of attachment 288719 [details] [review]: .
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!
We fixed this by addressing a related problem in bug 723160. *** This bug has been marked as a duplicate of bug 723160 ***