Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
a4216f88
Commit
a4216f88
authored
16 years ago
by
Laurent Van Migroet
Browse files
Options
Downloads
Patches
Plain Diff
Prepro directive for visual 2003.
vsnprintf unknown in visual 2003
parent
b603d917
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Common/Message.cpp
+16
-10
16 additions, 10 deletions
Common/Message.cpp
with
16 additions
and
10 deletions
Common/Message.cpp
+
16
−
10
View file @
a4216f88
...
...
@@ -22,6 +22,12 @@
extern
GUI
*
WID
;
#endif
#ifdef _MSC_VER
#if(_MSC_VER==1310)//NET 2003
#define vsnprintf _vsnprintf
#endif
#endif
extern
Context_T
CTX
;
int
Message
::
_commRank
=
0
;
...
...
@@ -71,7 +77,7 @@ void Message::Exit(int level)
#endif
exit
(
level
);
}
#if defined(HAVE_FLTK)
// if we exit cleanly (level==0) and we are in full GUI mode, save
// the persistent info to disk
...
...
@@ -181,7 +187,7 @@ void Message::Error(const char *fmt, ...)
#endif
if
(
CTX
.
terminal
){
if
(
_commSize
>
1
)
if
(
_commSize
>
1
)
fprintf
(
stderr
,
"Error : [On processor %d] %s
\n
"
,
_commRank
,
str
);
else
fprintf
(
stderr
,
"Error : %s
\n
"
,
str
);
...
...
@@ -280,7 +286,7 @@ void Message::Direct(int level, const char *fmt, ...)
WID
->
create_message_window
();
}
#endif
if
(
CTX
.
terminal
){
fprintf
(
stdout
,
"%s
\n
"
,
str
);
fflush
(
stdout
);
...
...
@@ -337,7 +343,7 @@ void Message::Debug(const char *fmt, ...)
#endif
if
(
CTX
.
terminal
){
if
(
_commSize
>
1
)
if
(
_commSize
>
1
)
fprintf
(
stdout
,
"Debug : [On processor %d] %s
\n
"
,
_commRank
,
str
);
else
fprintf
(
stdout
,
"Debug : %s
\n
"
,
str
);
...
...
@@ -392,7 +398,7 @@ void Message::PrintTimers()
{
// do a single stdio call!
std
::
string
str
;
for
(
std
::
map
<
std
::
string
,
double
>::
iterator
it
=
_timers
.
begin
();
for
(
std
::
map
<
std
::
string
,
double
>::
iterator
it
=
_timers
.
begin
();
it
!=
_timers
.
end
();
it
++
){
if
(
it
!=
_timers
.
begin
())
str
+=
", "
;
char
tmp
[
256
];
...
...
@@ -402,7 +408,7 @@ void Message::PrintTimers()
if
(
!
str
.
size
())
return
;
if
(
CTX
.
terminal
){
if
(
_commSize
>
1
)
if
(
_commSize
>
1
)
fprintf
(
stdout
,
"Timers : [On processor %d] %s
\n
"
,
_commRank
,
str
.
c_str
());
else
fprintf
(
stdout
,
"Timers : %s
\n
"
,
str
.
c_str
());
...
...
@@ -439,9 +445,9 @@ void Message::PrintErrorCounter(const char *title)
#endif
if
(
CTX
.
terminal
){
fprintf
(
stderr
,
"%s
\n
%s
\n
%s
\n
%s
\n
%s
\n
%s
\n
"
,
(
prefix
+
line
).
c_str
(),
fprintf
(
stderr
,
"%s
\n
%s
\n
%s
\n
%s
\n
%s
\n
%s
\n
"
,
(
prefix
+
line
).
c_str
(),
(
prefix
+
title
).
c_str
(),
(
prefix
+
warn
).
c_str
(),
(
prefix
+
err
).
c_str
(),
(
prefix
+
help
).
c_str
(),
(
prefix
+
err
).
c_str
(),
(
prefix
+
help
).
c_str
(),
(
prefix
+
line
).
c_str
());
fflush
(
stderr
);
}
...
...
@@ -474,7 +480,7 @@ double Message::GetValue(const char *text, double defaultval)
return
atof
(
str
);
}
bool
Message
::
GetBinaryAnswer
(
const
char
*
question
,
const
char
*
yes
,
bool
Message
::
GetBinaryAnswer
(
const
char
*
question
,
const
char
*
yes
,
const
char
*
no
,
bool
defaultval
)
{
// if a callback is given let's assume we don't want to be bothered
...
...
@@ -491,7 +497,7 @@ bool Message::GetBinaryAnswer(const char *question, const char *yes,
#endif
while
(
1
){
printf
(
"%s
\n\n
[%s] or [%s]? (default=%s) "
,
question
,
yes
,
no
,
printf
(
"%s
\n\n
[%s] or [%s]? (default=%s) "
,
question
,
yes
,
no
,
defaultval
?
yes
:
no
);
char
str
[
256
];
char
*
ret
=
fgets
(
str
,
sizeof
(
str
),
stdin
);
...
...
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