Commit 96e48968 authored by Allison Karlitskaya's avatar Allison Karlitskaya

invert gthread-impl includes

configure.ac defined G_THREAD_SOURCE and gthread-impl would #include it.

Instead, since we only have two thread implementations now, and since we
always use the Windows one only on Windows, move the logic to the
Makefile, predicated on 'if OS_WIN32'.  Then have the chosen backend do
the #include "gthread-impl.c" from there.

Remove the G_THREAD_SOURCE define from configure.ac.
parent fc6a9275
......@@ -2419,8 +2419,6 @@ case $host in
;;
esac
AC_DEFINE_UNQUOTED(G_THREAD_SOURCE,"gthread-$have_threads.c",
[Source file containing thread implementation])
AC_SUBST(G_THREAD_CFLAGS)
AC_SUBST(G_THREAD_LIBS)
AC_SUBST(G_THREAD_LIBS_FOR_GTHREAD)
......
......@@ -66,7 +66,11 @@ gthread_win32_res = gthread-win32-res.o
gthread_win32_res_ldflag = -Wl,$(gthread_win32_res)
endif
libgthread_2_0_la_SOURCES = gthread-impl.c
if OS_WIN32
libgthread_2_0_la_SOURCES = gthread-win32.c
else
libgthread_2_0_la_SOURCES = gthread-posix.c
endif
libgthread_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
$(gthread_win32_res_ldflag) \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
......
......@@ -31,13 +31,6 @@
* MT safe
*/
#include "config.h"
#include "glib.h"
#include "gthreadprivate.h"
#include G_THREAD_SOURCE
void
g_thread_init (GThreadFunctions *init)
{
......
......@@ -33,6 +33,9 @@
#include "config.h"
#include "glib.h"
#include "gthreadprivate.h"
#include <pthread.h>
#include <errno.h>
#include <stdlib.h>
......@@ -402,3 +405,5 @@ static GThreadFunctions g_thread_functions_for_glib_use_default =
g_thread_self_posix_impl,
g_thread_equal_posix_impl
};
#include "gthread-impl.c"
......@@ -35,6 +35,7 @@
#include "config.h"
#include "glib.h"
#include "gthreadprivate.h"
#define STRICT
#define _WIN32_WINDOWS 0x0401 /* to get IsDebuggerPresent */
......@@ -558,3 +559,5 @@ g_thread_impl_init ()
(g_cond_event_tls = TlsAlloc ()));
InitializeCriticalSection (&g_thread_global_spinlock);
}
#include "gthread-impl.c"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment