Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
787aa466
Commit
787aa466
authored
Jul 21, 2015
by
Artem Martynovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable usage of wchar_t in tests.
parent
5508607d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
6 deletions
+21
-6
include/spdlog/common.h
include/spdlog/common.h
+5
-1
include/spdlog/details/format.h
include/spdlog/details/format.h
+1
-1
include/spdlog/details/os.h
include/spdlog/details/os.h
+8
-4
include/spdlog/tweakme.h
include/spdlog/tweakme.h
+6
-0
tests/includes.h
tests/includes.h
+1
-0
No files found.
include/spdlog/common.h
View file @
787aa466
...
...
@@ -36,7 +36,11 @@
#define SPDLOG_NOEXCEPT throw()
#endif
#ifdef WIN32
#if !defined(SPDLOG_NO_WCHAR) && defined(WIN32)
#define SPDLOG_USE_WCHAR
#endif
#if defined(WIN32) && defined(SPDLOG_USE_WCHAR)
typedef
std
::
wstring
tstring
;
typedef
wchar_t
tchar
;
#define S(s) L ## s
...
...
include/spdlog/details/format.h
View file @
787aa466
...
...
@@ -2638,7 +2638,7 @@ public:
typedef
BasicMemoryWriter
<
char
>
MemoryWriter
;
typedef
BasicMemoryWriter
<
wchar_t
>
WMemoryWriter
;
#if
def WIN32
#if
defined(WIN32) && defined(SPDLOG_USE_WCHAR)
#define TMemoryWriter WMemoryWriter
#else
#define TMemoryWriter MemoryWriter
...
...
include/spdlog/details/os.h
View file @
787aa466
...
...
@@ -149,8 +149,12 @@ constexpr inline unsigned short eol_size()
//fopen_s on non windows for writing
inline
int
fopen_s
(
FILE
**
fp
,
const
tstring
&
filename
,
const
tchar
*
mode
)
{
#ifdef _WIN32
#if defined(WIN32)
#if defined(SPDLOG_USE_WCHAR)
*
fp
=
_wfsopen
((
filename
.
c_str
()),
mode
,
_SH_DENYWR
);
#else
*
fp
=
_fsopen
((
filename
.
c_str
()),
mode
,
_SH_DENYWR
);
#endif
return
*
fp
==
nullptr
;
#else
*
fp
=
fopen
((
filename
.
c_str
()),
mode
);
...
...
@@ -160,7 +164,7 @@ inline int fopen_s(FILE** fp, const tstring& filename, const tchar* mode)
inline
int
remove
(
const
tchar
*
filename
)
{
#if
def _WIN32
#if
defined(WIN32) && defined(SPDLOG_USE_WCHAR)
return
_wremove
(
filename
);
#else
return
std
::
remove
(
filename
);
...
...
@@ -169,10 +173,10 @@ inline int remove(const tchar* filename)
inline
int
rename
(
const
tchar
*
filename1
,
const
tchar
*
filename2
)
{
#if
def _WIN32
#if
defined(WIN32) && defined(SPDLOG_USE_WCHAR)
return
_wrename
(
filename1
,
filename2
);
#else
return
std
::
re
move
(
filename1
);
return
std
::
re
name
(
filename1
,
filename2
);
#endif
}
...
...
include/spdlog/tweakme.h
View file @
787aa466
...
...
@@ -72,3 +72,9 @@
// Note that upon creating a logger the registry is modified by spdlog..
// #define SPDLOG_NO_REGISTRY_MUTEX
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to disable usage of wchar_t for file names on Windows.
// #define SPDLOG_NO_WCHAR
///////////////////////////////////////////////////////////////////////////////
tests/includes.h
View file @
787aa466
...
...
@@ -7,6 +7,7 @@
#include <chrono>
#include <exception>
#define SPDLOG_NO_WCHAR
#include "catch.hpp"
#include "../include/spdlog/spdlog.h"
#include "../include/spdlog/sinks/null_sink.h"
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