cmTimestamp: Declare component buffer before MinGW-specific code

This commit is contained in:
Antons Jeļkins
2021-11-16 18:34:48 +01:00
committed by Brad King
parent a5eed9e5e0
commit f0eae9292b

View File

@@ -192,6 +192,8 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
} }
} }
char buffer[16];
#ifdef __MINGW32__ #ifdef __MINGW32__
/* See a bug in MinGW: https://sourceforge.net/p/mingw-w64/bugs/793/. A work /* See a bug in MinGW: https://sourceforge.net/p/mingw-w64/bugs/793/. A work
* around is to try to use strftime() from ucrtbase.dll. */ * around is to try to use strftime() from ucrtbase.dll. */
@@ -210,8 +212,6 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
static T strftime = loadStrftime(); static T strftime = loadStrftime();
#endif #endif
char buffer[16];
size_t size = size_t size =
strftime(buffer, sizeof(buffer), formatString.c_str(), &timeStruct); strftime(buffer, sizeof(buffer), formatString.c_str(), &timeStruct);