#endif
#if defined(WIN32) && defined(__GNUC__)
-#define FORCE_ARG_STRING(x) #x
+#define STRINGIFY_THINGY(x) #x
+#define FORCE_ARG_STRING(x) STRINGIFY_THINGY(x)
#else
#define FORCE_ARG_STRING(x) x
#endif
#ifdef HAS_TIMES
EXT struct tms timesbuf;
#endif
+#if defined(WIN32) && defined(__GNUC__)
+static STRLEN na;
+#else
EXT STRLEN na; /* for use in SvPV when length is Not Applicable */
+#endif
/* for tmp use in stupid debuggers */
EXT int * di;
SV * TSv;
XPV * TXpv;
struct stat Tstatbuf;
+#ifdef HAS_TIMES
struct tms Ttimesbuf;
+#endif
/* XXX What about regexp stuff? */
Perl_opsave
!END!OF!SKIP!
+if ($CCTYPE eq 'GCC')
+ {
+ $skip_sym .= "Perl_na\n";
+ }
+
if ($define{'MYMALLOC'})
{
$skip_sym .= <<'!END!OF!SKIP!';
# newly built perl.
INST_DRV=c:
INST_TOP=$(INST_DRV)\perl5004.5x
-#BUILDOPT=-DUSE_THREADS
+BUILDOPT=-DUSE_THREADS
#
#define Win32_Winsock
#endif
+
+
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "EXTERN.h"
#endif
+struct tms {
+ long tms_utime;
+ long tms_stime;
+ long tms_cutime;
+ long tms_cstime;
+};
+
#ifndef START_EXTERN_C
#ifdef __cplusplus
# define START_EXTERN_C extern "C" {
*/
START_EXTERN_C
-struct tms {
- long tms_utime;
- long tms_stime;
- long tms_cutime;
- long tms_cstime;
-};
-
EXT int * win32_errno(void);
EXT char *** win32_environ(void);
EXT FILE* win32_stdin(void);
#include "EXTERN.h"
#include "perl.h"
+#ifdef USE_DECLSPEC_THREAD
__declspec(thread) struct perl_thread *Perl_current_thread = NULL;
+#endif
void
Perl_setTHR(struct perl_thread *t)
{
+#ifdef USE_DECLSPEC_THREAD
Perl_current_thread = t;
+#else
+ TlsSetValue(thr_key,t);
+#endif
}
struct perl_thread *
Perl_getTHR(void)
{
+#ifdef USE_DECLSPEC_THREAD
return Perl_current_thread;
+#else
+ return (struct perl_thread *) TlsGetValue(thr_key);
+#endif
}
void
START_EXTERN_C
-#if defined(PERLDLL) && (!defined(__BORLANDC__) || defined(_DLL))
+#if defined(PERLDLL) && defined(USE_DECLSPEC_THREAD) && (!defined(__BORLANDC__) || defined(_DLL))
extern __declspec(thread) struct perl_thread *Perl_current_thread;
#define SET_THR(t) (Perl_current_thread = t)
#define THR Perl_current_thread
#define THR Perl_getTHR()
#define SET_THR(t) Perl_setTHR(t)
#endif
+struct perl_thread;
void Perl_alloc_thread_key _((void));
int Perl_thread_create _((struct perl_thread *thr, thread_func_t *fn));
END_EXTERN_C
#define INIT_THREADS NOOP
-#define ALLOC_THREAD_KEY NOOP
+#define ALLOC_THREAD_KEY Perl_alloc_thread_key()
#define SET_THREAD_SELF(thr) Perl_set_thread_self(thr)
#define JOIN(t, avp) \