LoRd_MuldeR
9th July 2010, 08:53
I noticed this from the pthreads changelog:
2010-06-18 Ramiro Polla <ramiro.polla at gmail.com >
* autostatic.c: New file; call pthread_win32_process_*()
libary init/cleanup routines automatically on application start
when statically linked.
The "autostatic.c" looks like this:
#if defined(__MINGW32__) || defined(_MSC_VER)
#include "pthread.h"
#include "implement.h"
static void on_process_init(void)
{
pthread_win32_process_attach_np ();
}
static void on_process_exit(void)
{
pthread_win32_thread_detach_np ();
pthread_win32_process_detach_np ();
}
#if defined(__MINGW32__)
# define attribute_section(a) __attribute__((section(a)))
#elif defined(_MSC_VER)
# define attribute_section(a) __pragma(section(a,long,read)); __declspec(allocate(a))
#endif
attribute_section(".ctors") void *gcc_ctor = on_process_init;
attribute_section(".dtors") void *gcc_dtor = on_process_exit;
attribute_section(".CRT$XCU") void *msc_ctor = on_process_init;
attribute_section(".CRT$XPU") void *msc_dtor = on_process_exit;
#endif /* defined(__MINGW32__) || defined(_MSC_VER) */
Question: Is the stuff in "x264dll.c" still needed? Will it even double initialize/deinitialize and break something ???
2010-06-18 Ramiro Polla <ramiro.polla at gmail.com >
* autostatic.c: New file; call pthread_win32_process_*()
libary init/cleanup routines automatically on application start
when statically linked.
The "autostatic.c" looks like this:
#if defined(__MINGW32__) || defined(_MSC_VER)
#include "pthread.h"
#include "implement.h"
static void on_process_init(void)
{
pthread_win32_process_attach_np ();
}
static void on_process_exit(void)
{
pthread_win32_thread_detach_np ();
pthread_win32_process_detach_np ();
}
#if defined(__MINGW32__)
# define attribute_section(a) __attribute__((section(a)))
#elif defined(_MSC_VER)
# define attribute_section(a) __pragma(section(a,long,read)); __declspec(allocate(a))
#endif
attribute_section(".ctors") void *gcc_ctor = on_process_init;
attribute_section(".dtors") void *gcc_dtor = on_process_exit;
attribute_section(".CRT$XCU") void *msc_ctor = on_process_init;
attribute_section(".CRT$XPU") void *msc_dtor = on_process_exit;
#endif /* defined(__MINGW32__) || defined(_MSC_VER) */
Question: Is the stuff in "x264dll.c" still needed? Will it even double initialize/deinitialize and break something ???