From: Dr. Stephen Henson Date: Fri, 19 Nov 2010 00:11:44 +0000 (+0000) Subject: PR: 2376 X-Git-Tag: OpenSSL_1_0_1-beta1~429 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=ffca7b85c29b2a22d3e926cf5c65187ce1201780;hp=eef2fa00d96d952b6ed9244693474b826ae9f722 PR: 2376 Submitted by: Guenter Reviewed by: steve Cleanup alloca use, fix Win32 target for OpenWatcom. --- diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index b4449b86d6..14bae0d08c 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -743,6 +743,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, #if defined(_WIN32) && !defined(__CYGWIN__) #include #include +#ifdef __WATCOMC__ +#if defined(_UNICODE) || defined(__UNICODE__) +#define _vsntprintf _vsnwprintf +#else +#define _vsntprintf _vsnprintf +#endif +#endif +#ifdef _MSC_VER +#define alloca _alloca +#endif #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 int OPENSSL_isservice(void) @@ -773,11 +783,7 @@ int OPENSSL_isservice(void) if (len>512) return -1; /* paranoia */ len++,len&=~1; /* paranoia */ -#ifdef _MSC_VER - name=(WCHAR *)_alloca(len+sizeof(WCHAR)); -#else name=(WCHAR *)alloca(len+sizeof(WCHAR)); -#endif if (!GetUserObjectInformationW (h,UOI_NAME,name,len,&len)) return -1; @@ -822,11 +828,7 @@ void OPENSSL_showfatal (const char *fmta,...) size_t len_0=strlen(fmta)+1,i; WCHAR *fmtw; -#ifdef _MSC_VER - fmtw = (WCHAR *)_alloca (len_0*sizeof(WCHAR)); -#else - fmtw = (WCHAR *)alloca (len_0*sizeof(WCHAR)); -#endif + fmtw = (WCHAR *)alloca(len_0*sizeof(WCHAR)); if (fmtw == NULL) { fmt=(const TCHAR *)L"no stack?"; break; } #ifndef OPENSSL_NO_MULTIBYTE