Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
0c6a0d52
Commit
0c6a0d52
authored
Oct 18, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fopen_s adapter in details::os
parent
f4d9c31a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
os.h
include/c11log/details/os.h
+15
-2
No files found.
include/c11log/details/os.h
View file @
0c6a0d52
#pragma once
#include<string>
#include<cstdio>
#include<ctime>
...
...
@@ -13,10 +14,11 @@ namespace os
inline
std
::
tm
localtime
(
const
std
::
time_t
&
time_tt
)
{
std
::
tm
tm
;
#ifdef _WIN32
std
::
tm
tm
;
localtime_s
(
&
tm
,
&
time_tt
);
#else
std
::
tm
tm
;
localtime_r
(
&
time_tt
,
&
tm
);
#endif
return
tm
;
...
...
@@ -64,11 +66,22 @@ inline unsigned short eol_size()
#else
constexpr
inline
unsigned
short
eol_size
()
{
return
1
;
}
#endif
//fopen_s on non windows for writing
inline
bool
fopen_s
(
FILE
**
fp
,
const
std
::
string
&
filename
,
const
char
*
mode
)
{
#ifdef _WIN32
return
fopen_s
(
fp
,
filename
,
mode
);
#else
*
fp
=
fopen
((
filename
.
c_str
()),
mode
);
return
fp
==
nullptr
;
#endif
}
}
//os
}
//details
}
//c11log
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment