cmTimestamp: Declare component buffer before MinGW-specific code

This commit is contained in:
Antons Jeļkins
2021-11-18 09:17:38 -05:00
committed by Brad King
parent a5eed9e5e0
commit f0eae9292b
+2 -2
View File
@@ -192,6 +192,8 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
}
}
char buffer[16];
#ifdef __MINGW32__
/* 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. */
@@ -210,8 +212,6 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
static T strftime = loadStrftime();
#endif
char buffer[16];
size_t size =
strftime(buffer, sizeof(buffer), formatString.c_str(), &timeStruct);