From: Georgi Valkov Date: Thu, 11 Jul 2024 06:32:47 +0000 (+0300) Subject: o_fopen: fix coding style and build error with VS2010 X-Git-Tag: openssl-3.4.0-alpha1~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20da3dabc43ee8c664090981336ec11605ff174b;p=thirdparty%2Fopenssl.git o_fopen: fix coding style and build error with VS2010 Follow the coding style to place variable definitions before code Fixes a build error on Windows 2003 with VS2010 introduced in [1] crypto\o_fopen.c(45) : error C2143: syntax error : missing ';' before 'type' crypto\o_fopen.c(46) : error C2275: 'DWORD' : illegal use of this type as an expression E:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\windef.h(152) : see declaration of 'DWORD' crypto\o_fopen.c(46) : error C2146: syntax error : missing ';' before identifier 'flags' crypto\o_fopen.c(46) : error C2065: 'flags' : undeclared identifier [1] https://github.com/openssl/openssl/commit/917f37195ac95252a4c90e86d7d7414c5569aed8 Signed-off-by: Georgi Valkov Reviewed-by: Tom Cosgrove Reviewed-by: Neil Horman Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/24853) --- diff --git a/crypto/o_fopen.c b/crypto/o_fopen.c index ed73e95578e..b12a94d1548 100644 --- a/crypto/o_fopen.c +++ b/crypto/o_fopen.c @@ -38,12 +38,15 @@ FILE *openssl_fopen(const char *filename, const char *mode) { FILE *file = NULL; +# if defined(_WIN32) && defined(CP_UTF8) + int sz, len_0; + DWORD flags; +# endif if (filename == NULL) return NULL; # if defined(_WIN32) && defined(CP_UTF8) - int sz, len_0 = (int)strlen(filename) + 1; - DWORD flags; + len_0 = (int)strlen(filename) + 1; /* * Basically there are three cases to cover: a) filename is