1. 10 Jul, 2019 2 commits
    • Chun-wei Fan's avatar
      gmacros.h: Support deprecation macros better on clang-cl · d616ca25
      Chun-wei Fan authored
      Use the GCC-style definition for the deprecation warning macros so that
      builds using those won't break due to how they are placed as clang-cl
      seems to not support __declspec(deprecated) very well.  Also make sure
      that we do indeed support the temparary disabling of deprecation
      warnings on clang-cl, as the MSVC ones don't really work on clang-cl.
    • Chun-wei Fan's avatar
      glib/gmacros.h: Check for __clang__ for g_autoptr · 2bc73d72
      Chun-wei Fan authored
      clang-cl does support __attribute__((cleanup)), which is what is used
      for the g_auto* macros, but neither it, nor clang.exe defines __GNUC__
      when they are used in a MSVC cmd.exe environment.  It does, however,
      define __clang__.
      So, check for the presence of the __clang__ macro to enable g_autoptr as
      well, so that we can build things with MSVC builds that make use
      of g_autoptr via pretending to be MSVC by using clang-cl.
  2. 09 Jul, 2019 1 commit
  3. 05 Jul, 2019 7 commits
    • Chun-wei Fan's avatar
      glib/tests/gdatetime.c: Fix TZ envvar test on Windows · 5d547271
      Chun-wei Fan authored
      Windows does not recognize the "America/Recife" as a valid timezone
      identifier, so setting the TZ envvar to that will result in "UTC" to
      be returned on Windows.
      Instead, set TZ to be the Windows equivilant "SA Eastern Standard
      Time", and see whether that is indeed our identifier when we create the
      GTimeZone using that.
    • Chun-wei Fan's avatar
      gtimezone.c: Fix identifier assignment on Windows · f24444c5
      Chun-wei Fan authored
      On Windows, we may be using the US DST boundaries by using the default
      "Pacific Standard Time" for rules_from_windows_time_zone() in
      rules_from_identifier().  This has the unfortunate side-effect of
      hardcoding the out_identifier to "Pacific Standard Time", which is
      likely not what we want.
      Instead, upon retrieving the items successfully using
      rules_from_windows_time_zone ("Pacific Standard Time", ...), we just
      set the out_identifier to whatever identifier that was passed into
    • Chun-wei Fan's avatar
      Update the gdatetime Test Program for Windows · 5ca4ac16
      Chun-wei Fan authored
      Update the gdatetime test program to make use of the updates that was
      done in gtimezone.c in the previous commit, so that we don't have to
      worry what language version of Windows the tests are being run in, but
      instead be assured that we produce and check for the English-language
      time zone name strings.
      Also, instead of testing for "Pacific Standard Time" in
      test_GDAteTime_printf(), use GetDynamicTimeZoneInformation() to get the
      actual time zone string (where the system running the test program is)
      we want to check for, because on Windows the actual result will be
      dependent on which timezone the system running the test program is in.
    • Chun-wei Fan's avatar
      glib/gtimezone.c: Use RegLoadMUIStringW() to query Std/Dlt strings · 2e5d3aa9
      Chun-wei Fan authored
      The existing method of using RegQueryValueExW() to query the Std/Dlt
      strings can only retrive the localized versions of those strings, so
      that means they will vary by the language version of Windows.  Instead,
      use RegQueryValueExW() only as a fallback when RegLoadMUIStringW() fails,
      as RegLoadMUIStringW() can query for the Std and Dlt strings in
      whatever language we need by setting the locale stuff programatically on
      the fly.
    • Chun-wei Fan's avatar
      glib/gtimezone.c: Use Unicode versions of Windows Registry API · c868123c
      Chun-wei Fan authored
      We are going to use RegLoadMUIStringW() in the next commit, since there
      is no real RegLoadMUIStringA() function (it exists as a stub only).
      This is done so that we are consistent along the way
      Also fix rule_from_windows_time_zone_info() as we can't just do a strncpy()
      of tzi->StandardName and tzi->DaylightName directly, as they are wchar_t/
      gunichar2 strings, where we must convert to UTF-8 first.
    • Daniel Boles's avatar
      docs.c: Forward link from g_auto* → G_DEFINE_AUTO* · 71ccfadb
      Daniel Boles authored
      We said the type must support being cleaned up and will be cleaned up in
      an appropriate way, but in order to figure out how to do that, you had
      to jump forward in the documentation to the other macros. Just say them.
    • Ting-Wei Lan's avatar
      gdatetime: Unset LC_ALL for the test as well · 7089f67f
      Ting-Wei Lan authored
      This is a follow-up to a0c7f854.
      In addition LC_MESSAGES, we should remove LC_ALL from the environment
      as well. Otherwise, LC_ALL overrides LC_MESSAGES, causing the test to
      fail on FreeBSD when LC_ALL is set to a non-English locale.
  4. 02 Jul, 2019 3 commits
    • Allison Karlitskaya's avatar
      tests: test g_cond_wait_until() under stress · de009c1e
      Allison Karlitskaya authored
      This (dubious) testcase fails before the previous commit due to errno
      being clobbered by the interrupted wait on the contended mutex.  The
      previous commit fixes that.
      The testcase is dubious because, in theory (as per POSIX),
      g_cond_wait_until() is permitted to return TRUE at any time for any
      reason, due to so-called "spurious wakeups".  Having a testcase that
      asserts that the return value should be FALSE is therefore fundamentally
      broken.  We do it anyway, though.
      We're only really trying to test a bug in our homemade Linux/futex
      implementation here, and it takes a fair amount of effort to actually
      convince the old code to fail (including some system stuff which
      probably isn't available on Windows).  There's also the spurious wakeup
      situation mentioned above to worry about on other systems.  For all of
      those reasons, this test is only enabled on Linux.
    • Allison Karlitskaya's avatar
      gthread: fix minor errno problem in GCond · d92f22ab
      Allison Karlitskaya authored
      The return value from `g_cond_wait_until()` is calculated, based on the
      value of `errno` after reacquiring the mutex.  This is a problem because
      `errno` can be overwritten in the case the mutex is contended (in which
      case the slow-path code will re-enter the kernel).
      Perform the calculation before reacquiring the mutex.
      See merge request GNOME/glib!958
    • Chun-wei Fan's avatar
      gmacros.h: Use static_assert on MSVC if possible · 7b91440c
      Chun-wei Fan authored
      Visual Studio 2010 and later support static_assert on both C and C++,
      but we can only enable it for plain-C code on Visual Studio 2013 and
      later, as apparently the static_assert macro implementation will carry
      out something after defining certain variables.
      For C++ code, we use static_assert on Visual Studio 2010 and later.
  5. 01 Jul, 2019 1 commit
  6. 29 Jun, 2019 3 commits
  7. 27 Jun, 2019 4 commits
  8. 26 Jun, 2019 2 commits
  9. 25 Jun, 2019 1 commit
  10. 24 Jun, 2019 1 commit
    • Ting-Wei Lan's avatar
      gutils: Don't limit the length of the host name to 99 · 446ba28d
      Ting-Wei Lan authored
      It is unclear that why the size of the buffer was chosen to be 100
      because the commit introduced the code didn't mention the reason.
      POSIX defines _POSIX_HOST_NAME_MAX to be 255 and provides a way to
      determine the suitable value with sysconf, so we should use it instead
      of hard-coding a small value.
  11. 21 Jun, 2019 6 commits
  12. 20 Jun, 2019 1 commit
  13. 19 Jun, 2019 2 commits
    • Chun-wei Fan's avatar
      glib/tests/fileutils.c: Fix stdio Wrapper Test on Windows · 7a72d3bb
      Chun-wei Fan authored
      The g_creat() call was done in *nix style in regards to the mode parameter,
      which the Windows CRT isn't going to understand (nor like, on newer CRTs).
      Update the program such that it will pass, by using Windows-style
      permission mode parameters for g_creat(), on Windows.
    • Chun-wei Fan's avatar
      glib/tests/convert.c: Skip tests that aren't meaningful for Windows · 6e224f76
      Chun-wei Fan authored
      On Windows, everything is assumed as UTF-8 in g_get_filename_charsets(),
      so setting G_FILENAME_ENCODING envvar has no effect, so we can just skip
      the test on g_get_filename_charsets() where we try to influence it by
      setting the G_FILENAME_ENCODING envvar.
  14. 18 Jun, 2019 2 commits
    • Chun-wei Fan's avatar
      glib-private.h: Set the appropriate string for setlocale() · 3e5d1bd6
      Chun-wei Fan authored
      On Windows, in particular the CRTs on and after Visual Studio 2012, it
      is not enough just to do setlocale (LC_ALL, "") to set the default
      system locale, which results in the tools that use the translated
      messages to show unreadable messages when running the commmand line
      This adds an entry in glib-private.h.in which denotes the appropriate
      string to use for setlocale() to set the default system locale by
      setting it to ".ACP" if we are building on Windows and "" for
      other systems (as we are doing now).
      The tools in gio/ will be updated in the next commit to make use of this
      entry so that the translated messages can be shown correctly.
    • Chun-wei Fan's avatar
      glib/tests/refcount.c: Only expect saturation tests to pass on GCC · bf40b7c7
      Chun-wei Fan authored
      From grefcount.h, in order to disable warnings when G_DISABLE_CHECKS is
      defined, we need to make use of the GCC-isque-only __extension__ for it
      to work.  This means that in the saturation tests, we can only expect no
      warnings to show if we are building on GCC-isque compilers with
      G_DISABLE_CHECKS defined.
      This will fix the refcount-macro test on Visual Studio builds at least.
  15. 17 Jun, 2019 1 commit
  16. 14 Jun, 2019 1 commit
  17. 07 Jun, 2019 1 commit
  18. 04 Jun, 2019 1 commit