Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
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
rapidjson
Commits
294a5aca
Commit
294a5aca
authored
Mar 06, 2018
by
MaximeBF
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support long and unsined long as int and unsigned on Microsft platforms
parent
8bf4f7b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
document.h
include/rapidjson/document.h
+20
-0
No files found.
include/rapidjson/document.h
View file @
294a5aca
...
...
@@ -451,6 +451,26 @@ struct TypeHelper<ValueType, unsigned> {
static
ValueType
&
Set
(
ValueType
&
v
,
unsigned
data
,
typename
ValueType
::
AllocatorType
&
)
{
return
v
.
SetUint
(
data
);
}
};
#ifdef _MSC_VER
RAPIDJSON_STATIC_ASSERT
(
sizeof
(
long
)
==
sizeof
(
int
));
template
<
typename
ValueType
>
struct
TypeHelper
<
ValueType
,
long
>
{
static
bool
Is
(
const
ValueType
&
v
)
{
return
v
.
IsInt
();
}
static
long
Get
(
const
ValueType
&
v
)
{
return
v
.
GetInt
();
}
static
ValueType
&
Set
(
ValueType
&
v
,
long
data
)
{
return
v
.
SetInt
(
data
);
}
static
ValueType
&
Set
(
ValueType
&
v
,
long
data
,
typename
ValueType
::
AllocatorType
&
)
{
return
v
.
SetInt
(
data
);
}
};
RAPIDJSON_STATIC_ASSERT
(
sizeof
(
unsigned
long
)
==
sizeof
(
unsigned
));
template
<
typename
ValueType
>
struct
TypeHelper
<
ValueType
,
unsigned
long
>
{
static
bool
Is
(
const
ValueType
&
v
)
{
return
v
.
IsUint
();
}
static
unsigned
long
Get
(
const
ValueType
&
v
)
{
return
v
.
GetUint
();
}
static
ValueType
&
Set
(
ValueType
&
v
,
unsigned
long
data
)
{
return
v
.
SetUint
(
data
);
}
static
ValueType
&
Set
(
ValueType
&
v
,
unsigned
long
data
,
typename
ValueType
::
AllocatorType
&
)
{
return
v
.
SetUint
(
data
);
}
};
#endif
template
<
typename
ValueType
>
struct
TypeHelper
<
ValueType
,
int64_t
>
{
static
bool
Is
(
const
ValueType
&
v
)
{
return
v
.
IsInt64
();
}
...
...
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