From bef0d7976449285c21df4e80656338288fcbdf5c Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 20 Jun 2022 11:38:28 -0700 Subject: [PATCH] unicode_gif.h: fix -Wdeclaration-after-statement when building for windows with _UNICODE defined unicode_gif.h|49 col 3| warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] Change-Id: Ib9f0cc0eba036d6cd4221a4f70a078770dde01d0 --- examples/unicode_gif.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/unicode_gif.h b/examples/unicode_gif.h index afcd46bd..626c6e72 100644 --- a/examples/unicode_gif.h +++ b/examples/unicode_gif.h @@ -45,18 +45,19 @@ static GifFileType* DGifOpenFileUnicode(const W_CHAR* file_name, int* error) { } #if defined(_WIN32) && defined(_UNICODE) - - int file_handle = _wopen(file_name, _O_RDONLY | _O_BINARY); - if (file_handle == -1) { - if (error != NULL) *error = D_GIF_ERR_OPEN_FAILED; - return NULL; - } + { + int file_handle = _wopen(file_name, _O_RDONLY | _O_BINARY); + if (file_handle == -1) { + if (error != NULL) *error = D_GIF_ERR_OPEN_FAILED; + return NULL; + } #if LOCAL_GIF_PREREQ(5, 0) - return DGifOpenFileHandle(file_handle, error); + return DGifOpenFileHandle(file_handle, error); #else - return DGifOpenFileHandle(file_handle); + return DGifOpenFileHandle(file_handle); #endif + } #else