summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-11-08 07:16:10 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-11-08 07:16:10 +0000
commit3352bfcb1116ab429a5d6310d2803aabbed4237e (patch)
tree809727ad206ea66558325bfd6914bc3a7dbea2f4 /win32/win32.c
parent7a1c55545340734b4c7e5b94b34d2b199bf3e739 (diff)
downloadperl-3352bfcb1116ab429a5d6310d2803aabbed4237e.tar.gz
win32 internal data must be interpreter-local
p4raw-id: //depot/perl@4536
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 3f56f600f3..cf341cdb62 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -100,29 +100,6 @@ HANDLE w32_perldll_handle = INVALID_HANDLE_VALUE;
char w32_module_name[MAX_PATH+1];
static DWORD w32_platform = (DWORD)-1;
-#ifdef USE_THREADS
-# ifdef USE_DECLSPEC_THREAD
-__declspec(thread) char strerror_buffer[512];
-__declspec(thread) char getlogin_buffer[128];
-__declspec(thread) char w32_perllib_root[MAX_PATH+1];
-# ifdef HAVE_DES_FCRYPT
-__declspec(thread) char crypt_buffer[30];
-# endif
-# else
-# define strerror_buffer (thr->i.Wstrerror_buffer)
-# define getlogin_buffer (thr->i.Wgetlogin_buffer)
-# define w32_perllib_root (thr->i.Ww32_perllib_root)
-# define crypt_buffer (thr->i.Wcrypt_buffer)
-# endif
-#else
-static char strerror_buffer[512];
-static char getlogin_buffer[128];
-static char w32_perllib_root[MAX_PATH+1];
-# ifdef HAVE_DES_FCRYPT
-static char crypt_buffer[30];
-# endif
-#endif
-
int
IsWin95(void)
{
@@ -916,8 +893,8 @@ char *
getlogin(void)
{
dTHXo;
- char *buf = getlogin_buffer;
- DWORD size = sizeof(getlogin_buffer);
+ char *buf = w32_getlogin_buffer;
+ DWORD size = sizeof(w32_getlogin_buffer);
if (GetUserName(buf,&size))
return buf;
return (char*)NULL;
@@ -1582,7 +1559,7 @@ win32_crypt(const char *txt, const char *salt)
dTHXo;
#ifdef HAVE_DES_FCRYPT
dTHR;
- return des_fcrypt(txt, salt, crypt_buffer);
+ return des_fcrypt(txt, salt, w32_crypt_buffer);
#else
die("The crypt() function is unimplemented due to excessive paranoia.");
return Nullch;
@@ -1808,10 +1785,11 @@ win32_strerror(int e)
e = GetLastError();
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, &source, e, 0,
- strerror_buffer, sizeof(strerror_buffer), NULL) == 0)
- strcpy(strerror_buffer, "Unknown Error");
+ w32_strerror_buffer,
+ sizeof(w32_strerror_buffer), NULL) == 0)
+ strcpy(w32_strerror_buffer, "Unknown Error");
- return strerror_buffer;
+ return w32_strerror_buffer;
}
return strerror(e);
}
@@ -2971,8 +2949,8 @@ static
XS(w32_LoginName)
{
dXSARGS;
- char *name = getlogin_buffer;
- DWORD size = sizeof(getlogin_buffer);
+ char *name = w32_getlogin_buffer;
+ DWORD size = sizeof(w32_getlogin_buffer);
EXTEND(SP,1);
if (GetUserName(name,&size)) {
/* size includes NULL */