glib/tests
Loic Le Page 42c77c7ac7 Enable full-static build on Windows
Glib cannot be built statically on Windows because glib, gobject and gio
modules need to perform specific initialization when DLL are loaded and
cleanup when unloaded. Those initializations and cleanups are performed
using the DllMain function which is not called with static builds.

Issue is known for a while and solutions were already proposed but never
merged (see: https://gitlab.gnome.org/GNOME/glib/-/issues/692). Last
patch is from version 2.36.x and since then the
"constructor/destructor" mechanism has been implemented and used in
other part of the system.

This patch takes back the old idea and updates it to the last version of
glib to allow static compilation on Windows.

WARNING: because DllMain doesn't exist anymore in static compilation
mode, there is no easy way of knowing when a Windows thread finishes.
This patch implements a workaround for glib threads created by calling
g_thread_new(), so all glib threads created through glib API will behave
exactly the same way in static and dynamic compilation modes.
Unfortunately, Windows threads created by using CreateThread() or
_beginthread/ex() will not work with glib TLS functions. If users need
absolutely to use a thread NOT created with glib API under Windows and
in static compilation mode, they should not use glib functions within
their thread or they may encounter memory leaks when the thread finishes.

This should not be an issue as users should use exclusively the glib API
to manipulate threads in order to be cross-platform compatible and this
would be very unlikely and cumbersome that they may mix up Windows native
threads API with glib one.

Closes #692
2022-01-26 10:14:02 +01:00
..
collate Add Collation tests. 2005-10-05 17:37:46 +00:00
gobject Merge tests/gobject/paramspec-test.c into gobject/tests/param.c 2022-01-17 20:43:27 +00:00
refcount Fix signedness warnings in tests/refcount/objects.c 2021-05-04 08:43:29 +02:00
assert-msg-test.c Normalize C source files to end with exactly one newline 2020-06-10 09:48:02 +01:00
assert-msg-test.gdb tests: Work around a gdb bug in assert-msg-test 2017-11-27 11:44:08 +00:00
file-test.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
gio-test.c Fix signedness warnings in tests/gio-test.c 2021-05-06 14:35:20 +02:00
iochannel-test-infile Modified Files: glib/ChangeLog glib/glib.def glib/glib/giochannel.c 2001-07-20 20:14:37 +00:00
iochannel-test.c iochannel-test: Fix leaks in test 2013-11-10 22:45:04 +01:00
libmoduletestplugin_a.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
libmoduletestplugin_b.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
mainloop-test.c Port internal uses to use g_source_set_static_name() 2021-07-26 11:01:07 +01:00
mapping-test.c tests W32: ifdef a variable not used on Windows 2018-09-21 08:45:54 -04:00
memchunks.c Fix signedness warning in tests/memchunks.c 2021-05-06 22:54:53 +02:00
meson.build Merge branch 'unicode_caseconv_tests' into 'main' 2022-01-19 15:54:19 +00:00
module-test.c Enable full-static build on Windows 2022-01-26 10:14:02 +01:00
onceinit.c Fix signedness warning in tests/onceinit.c 2021-04-29 12:40:05 +02:00
relation-test.c Normalize C source files to end with exactly one newline 2020-06-10 09:48:02 +01:00
run-assert-msg-test.sh Correct shellcheck errors (and ignore world splitting when we want it) 2020-11-15 17:34:27 +01:00
slice-color.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
slice-concurrent.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
slice-test.c Fix old_mem_chunk_new() does not match original declaration warning in tests/slice-test.c 2021-12-17 16:35:45 +01:00
slice-threadinit.c Fix missing initializer warning in tests/slice-threadinit.c 2021-05-27 10:16:52 +02:00
spawn-test-win32-gui.c gspawn, tests: extend spawn_test, run it on win32 2018-12-26 23:45:47 +03:00
spawn-test.c gspawn, tests: extend spawn_test, run it on win32 2018-12-26 23:45:47 +03:00
testgdate.c testgdate: fix -Wmisleading-indentation warning 2021-06-16 12:22:28 -05:00
testgdateparser.c Normalize C source files to end with exactly one newline 2020-06-10 09:48:02 +01:00
testglib.c utils: Add XDG_STATE_HOME support 2021-12-24 20:11:39 +00:00
thread-test.c Fix signedness warning in tests/thread-test.c 2021-05-06 22:54:53 +02:00
threadpool-test.c Fix several signedness warnings in tests/threadpool-test.c 2021-05-06 22:54:53 +02:00
timeloop-basic.c Normalize C source files to end with exactly one newline 2020-06-10 09:48:02 +01:00
timeloop.c Fix signedness warning in tests/timeloop.c 2021-05-04 16:13:41 +02:00
type-test.c win32: don't assume the format specifier for the stdlib printf/scanf like functions 2019-08-10 21:56:33 +02:00
unicode-encoding.c Fix several signedness warnings in tests/unicode-encoding.c 2021-05-06 22:54:53 +02:00
unicode-normalize.c Update to reflect Unicode PR #29 (#348694, Nikolai Weibull) 2006-07-31 04:50:05 +00:00
utf8.txt More clean up for Unicode corrigendum #9 2013-03-18 23:28:27 -04:00