diff --git a/autotests/mainshelltest.cpp b/autotests/mainshelltest.cpp index ec36d3790..f094fe25c 100644 --- a/autotests/mainshelltest.cpp +++ b/autotests/mainshelltest.cpp @@ -24,7 +24,11 @@ #include "../settings.h" #include +#ifndef Q_OS_WIN #include +#else +#include +#endif namespace Okular { class PartTest diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp index 850e22716..c16d6165e 100644 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -2147,8 +2147,13 @@ void PresentationWidget::initTransition( const Okular::PageTransition *transitio // randomize the grid for ( int i = 0; i < steps; i++ ) { +#ifndef Q_OS_WIN int n1 = (int)(steps * drand48()); int n2 = (int)(steps * drand48()); +#else + int n1 = (int)(steps * (std::rand() / RAND_MAX)); + int n2 = (int)(steps * (std::rand() / RAND_MAX)); +#endif // swap items if index differs if ( n1 != n2 ) { @@ -2238,8 +2243,13 @@ void PresentationWidget::initTransition( const Okular::PageTransition *transitio int randomSteps = steps / 20; for ( int i = 0; i < randomSteps; i++ ) { +#ifndef Q_OS_WIN int n1 = (int)(steps * drand48()); int n2 = (int)(steps * drand48()); +#else + int n1 = (int)(steps * (std::rand() / RAND_MAX)); + int n2 = (int)(steps * (std::rand() / RAND_MAX)); +#endif // swap items if index differs if ( n1 != n2 ) {