Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sumudu Kankanamge
dynare
Commits
149fde1e
Verified
Commit
149fde1e
authored
6 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Dynare++: detect Windows by testing for _WIN32 rather than __MINGW32__
parent
860e1e1c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dynare++/kord/journal.cc
+8
-8
8 additions, 8 deletions
dynare++/kord/journal.cc
with
8 additions
and
8 deletions
dynare++/kord/journal.cc
+
8
−
8
View file @
149fde1e
...
...
@@ -8,7 +8,7 @@
#include
<ctime>
#include
<limits>
#ifndef _
_MINGW32__
#ifndef _
WIN32
# include <sys/time.h> // For getrusage()
# include <sys/resource.h> // For getrusage()
# include <sys/utsname.h> // For uname()
...
...
@@ -29,7 +29,7 @@ const std::chrono::time_point<std::chrono::high_resolution_clock> SystemResource
long
SystemResources
::
pageSize
()
{
#ifndef _
_MINGW32__
#ifndef _
WIN32
return
sysconf
(
_SC_PAGESIZE
);
#else
return
1024
;
...
...
@@ -39,7 +39,7 @@ SystemResources::pageSize()
long
SystemResources
::
physicalPages
()
{
#ifndef _
_MINGW32__
#ifndef _
WIN32
return
sysconf
(
_SC_PHYS_PAGES
);
#else
MEMORYSTATUS
memstat
;
...
...
@@ -51,7 +51,7 @@ SystemResources::physicalPages()
long
SystemResources
::
availablePhysicalPages
()
{
#ifndef _
_MINGW32__
#ifndef _
WIN32
return
sysconf
(
_SC_AVPHYS_PAGES
);
#else
MEMORYSTATUS
memstat
;
...
...
@@ -63,7 +63,7 @@ SystemResources::availablePhysicalPages()
long
SystemResources
::
onlineProcessors
()
{
#ifndef _
_MINGW32__
#ifndef _
WIN32
return
sysconf
(
_SC_NPROCESSORS_ONLN
);
#else
return
-
1
;
...
...
@@ -82,7 +82,7 @@ SystemResources::SystemResources()
std
::
chrono
::
duration
<
double
>
duration
=
now
-
start
;
elapsed
=
duration
.
count
();
#ifndef _
_MINGW32__
#ifndef _
WIN32
struct
rusage
rus
;
getrusage
(
RUSAGE_SELF
,
&
rus
);
utime
=
rus
.
ru_utime
.
tv_sec
+
rus
.
ru_utime
.
tv_usec
*
1.0e-6
;
...
...
@@ -96,7 +96,7 @@ SystemResources::SystemResources()
majflt
=
-
1
;
#endif
#ifndef _
_MINGW32__
#ifndef _
WIN32
getloadavg
(
&
load_avg
,
1
);
#else
load_avg
=
std
::
numeric_limits
<
double
>::
quiet_NaN
();
...
...
@@ -210,7 +210,7 @@ Journal::printHeader()
<<
" for LGPL see http://www.gnu.org/licenses/lgpl.html
\n
"
<<
"
\n\n
"
<<
"System info: "
;
#ifndef _
_MINGW32__
#ifndef _
WIN32
utsname
info
;
uname
(
&
info
);
*
this
<<
info
.
sysname
<<
" "
<<
info
.
release
<<
" "
<<
info
.
version
<<
" "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment