On Sun, 19 Nov 2017, Jacek Caban wrote:

Hi Martin,


On 11/17/17 9:20 PM, Martin Storsjö wrote:
We can't redirect these to the function calls via defines, since "#define
timezone _timezone" will break any code that uses e.g. "struct timezone",
since "_timezone" is a define that expands into "(* __timezone())".

We can provide compat data variables here, but they are only updated
when we hook the _tzset function call. Only the module that calls
the _tzset function will see the updated values in the timezone/tzname
variables.

The unprefixed variable "daylight" is a less commonly used word, that
we can redirect to "_daylight" with a define without at least breaking
any struct declarations within the same header.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
Now by hooking the _tzset function, without using GetProcAddress.
---
  mingw-w64-crt/crt/ucrtbase_compat.c      | 23 +++++++++++++++++++++++
  mingw-w64-crt/lib-common/ucrtbase.def.in |  3 ++-
  mingw-w64-headers/crt/_mingw.h.in        |  7 +++++++
  mingw-w64-headers/crt/time.h             | 19 ++++++++++++++++---
  4 files changed, 48 insertions(+), 4 deletions(-)

This looks good to me. Thanks!

Thanks, pushed!

// Martin
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to