diff options
Diffstat (limited to 'tools/create_msvc/create_msvc.cpp')
-rw-r--r-- | tools/create_msvc/create_msvc.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/create_msvc/create_msvc.cpp b/tools/create_msvc/create_msvc.cpp index 7c891bdb02..51d0afe683 100644 --- a/tools/create_msvc/create_msvc.cpp +++ b/tools/create_msvc/create_msvc.cpp @@ -91,6 +91,11 @@ void displayHelp(const char *exe); } // End of anonymous namespace int main(int argc, char *argv[]) { +#if !(defined(_WIN32) || defined(WIN32)) + // Initialize random number generator for UUID creation + std::srand(std::time(0)); +#endif + if (argc < 2) { displayHelp(argv[0]); return -1; @@ -720,7 +725,6 @@ std::string createUUID() { return result; #else unsigned char uuid[16]; - std::srand(std::time(0)); for (int i = 0; i < 16; ++i) uuid[i] = (std::rand() / (double)(RAND_MAX)) * 0xFF; |