/* Obtain the current thread id */
TSRM_API THREAD_T tsrm_thread_id(void)
{
-#ifdef WIN32
+#ifdef TSRM_WIN32
return GetCurrentThreadId();
#elif defined(GNUPTH)
return pth_self();
{
MUTEX_T mutexp;
-#ifdef WIN32
+#ifdef TSRM_WIN32
mutexp = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(mutexp);
#elif defined(GNUPTH)
TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
{
if (mutexp) {
-#ifdef WIN32
+#ifdef TSRM_WIN32
DeleteCriticalSection(mutexp);
#elif defined(GNUPTH)
free(mutexp);
#if 0
tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
#endif
-#ifdef WIN32
+#ifdef TSRM_WIN32
EnterCriticalSection(mutexp);
return 1;
#elif defined(GNUPTH)
#if 0
tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
#endif
-#ifdef WIN32
+#ifdef TSRM_WIN32
LeaveCriticalSection(mutexp);
return 1;
#elif defined(GNUPTH)
/* Only compile multi-threading functions if we're in ZTS mode */
#ifdef ZTS
-#if WIN32||WINNT
+#ifdef TSRM_WIN32
# include <windows.h>
#elif defined(GNUPTH)
# include <pth.h>
typedef int ts_rsrc_id;
-#if WIN32||WINNT
+#ifdef TSRM_WIN32
# ifdef TSRM_EXPORTS
# define TSRM_API __declspec(dllexport)
# else
/* Define THREAD_T and MUTEX_T */
-#if defined(WIN32)
+#ifdef TSRM_WIN32
# define THREAD_T DWORD
# define MUTEX_T CRITICAL_SECTION *
#elif defined(GNUPTH)