summaryrefslogtreecommitdiff
path: root/win32/win32sck.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1997-11-29 18:38:26 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1997-11-29 18:38:26 +0000
commitc53bd28a003b43d77a08bf70a3cb54001d1f4afe (patch)
tree1bd925f336ec621412af1c931a2f82707dba7281 /win32/win32sck.c
parent4c36ecb7bb90b0ff73777a2addf5e8968d98eec5 (diff)
downloadperl-c53bd28a003b43d77a08bf70a3cb54001d1f4afe.tar.gz
Avoid __declspec(thread) by default, for both scratch
return areas and THR stuff. Use struct thread intern instead. p4raw-id: //depot/ansiperl@335
Diffstat (limited to 'win32/win32sck.c')
-rw-r--r--win32/win32sck.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/win32/win32sck.c b/win32/win32sck.c
index 670bcf424d..64d1a0a65c 100644
--- a/win32/win32sck.c
+++ b/win32/win32sck.c
@@ -57,7 +57,16 @@ static struct servent* win32_savecopyservent(struct servent*d,
struct servent*s,
const char *proto);
+#ifdef USE_THREADS
+#ifdef USE_DECLSPEC_THREAD
__declspec(thread) struct servent myservent;
+#else
+#define myservent (thr->i.Wservent)
+#endif
+#else
+static struct servent myservent;
+#endif
+
static int wsock_started = 0;
void
@@ -435,7 +444,8 @@ struct servent *
win32_getservbyname(const char *name, const char *proto)
{
struct servent *r;
-
+ dTHR;
+
SOCKET_TEST(r = getservbyname(name, proto), NULL);
if (r) {
r = win32_savecopyservent(&myservent, r, proto);
@@ -447,6 +457,7 @@ struct servent *
win32_getservbyport(int port, const char *proto)
{
struct servent *r;
+ dTHR;
SOCKET_TEST(r = getservbyport(port, proto), NULL);
if (r) {