Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
d5322423
Commit
d5322423
authored
Aug 27, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Very slightly better Py_BuildValue support
parent
c4e675ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
6 deletions
+36
-6
src/capi/modsupport.cpp
src/capi/modsupport.cpp
+36
-6
No files found.
src/capi/modsupport.cpp
View file @
d5322423
...
...
@@ -33,14 +33,44 @@ namespace pyston {
#define FLAG_SIZE_T 1
extern
"C"
PyObject
*
_Py_BuildValue_SizeT
(
const
char
*
arg0
,
...)
{
RELEASE_ASSERT
(
*
arg0
==
'\0'
,
""
);
return
None
;
static
PyObject
*
va_build_value
(
const
char
*
fmt
,
va_list
va
,
int
flags
)
{
int
len
=
strlen
(
fmt
);
if
(
len
==
0
)
return
None
;
if
(
len
==
1
)
{
switch
(
*
fmt
)
{
case
'b'
:
case
'B'
:
case
'h'
:
case
'i'
:
return
PyInt_FromLong
((
long
)
va_arg
(
va
,
int
));
default:
RELEASE_ASSERT
(
0
,
"%c"
,
*
fmt
);
}
}
RELEASE_ASSERT
(
0
,
""
);
}
extern
"C"
PyObject
*
_Py_BuildValue_SizeT
(
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
Box
*
r
=
va_build_value
(
fmt
,
ap
,
FLAG_SIZE_T
);
va_end
(
ap
);
return
r
;
}
extern
"C"
PyObject
*
Py_BuildValue
(
const
char
*
arg0
,
...)
{
RELEASE_ASSERT
(
*
arg0
==
'\0'
,
""
);
return
None
;
extern
"C"
PyObject
*
Py_BuildValue
(
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
Box
*
r
=
va_build_value
(
fmt
,
ap
,
0
);
va_end
(
ap
);
return
r
;
}
extern
"C"
PyObject
*
Py_InitModule4
(
const
char
*
name
,
PyMethodDef
*
methods
,
const
char
*
doc
,
PyObject
*
self
,
...
...
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