Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
f3e4aa2c
Commit
f3e4aa2c
authored
9 years ago
by
Nathaniel Manista
Browse files
Options
Downloads
Plain Diff
Merge pull request #2034 from soltanmm/pip89
Ensure C89 compatibility in Linux tests.
parents
f0b857f7
4b4181ed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python/src/grpc/_adapter/_c/utility.c
+10
-3
10 additions, 3 deletions
src/python/src/grpc/_adapter/_c/utility.c
tools/run_tests/build_python.sh
+1
-1
1 addition, 1 deletion
tools/run_tests/build_python.sh
with
11 additions
and
4 deletions
src/python/src/grpc/_adapter/_c/utility.c
+
10
−
3
View file @
f3e4aa2c
...
...
@@ -40,6 +40,7 @@
#include
<grpc/support/alloc.h>
#include
<grpc/support/slice.h>
#include
<grpc/support/time.h>
#include
<grpc/support/string_util.h>
#include
"grpc/_adapter/_c/types.h"
...
...
@@ -156,9 +157,10 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
return
0
;
}
if
(
PyTuple_Size
(
op
)
!=
OP_TUPLE_SIZE
)
{
char
buf
[
64
]
;
s
n
printf
(
buf
,
sizeof
(
buf
)
,
"expected tuple op of length %d"
,
OP_TUPLE_SIZE
);
char
*
buf
;
gpr_a
sprintf
(
&
buf
,
"expected tuple op of length %d"
,
OP_TUPLE_SIZE
);
PyErr_SetString
(
PyExc_ValueError
,
buf
);
gpr_free
(
buf
);
return
0
;
}
type
=
PyInt_AsLong
(
PyTuple_GET_ITEM
(
op
,
TYPE_INDEX
));
...
...
@@ -353,9 +355,14 @@ double pygrpc_cast_gpr_timespec_to_double(gpr_timespec timespec) {
return
timespec
.
tv_sec
+
1e-9
*
timespec
.
tv_nsec
;
}
/* Because C89 doesn't have a way to check for infinity... */
static
int
pygrpc_isinf
(
double
x
)
{
return
x
*
0
!=
0
;
}
gpr_timespec
pygrpc_cast_double_to_gpr_timespec
(
double
seconds
)
{
gpr_timespec
result
;
if
isinf
(
seconds
)
{
if
(
pygrpc_
isinf
(
seconds
)
)
{
result
=
seconds
>
0
.
0
?
gpr_inf_future
:
gpr_inf_past
;
}
else
{
result
.
tv_sec
=
(
time_t
)
seconds
;
...
...
This diff is collapsed.
Click to expand it.
tools/run_tests/build_python.sh
+
1
−
1
View file @
f3e4aa2c
...
...
@@ -38,5 +38,5 @@ rm -rf python2.7_virtual_environment
virtualenv
-p
/usr/bin/python2.7 python2.7_virtual_environment
source
python2.7_virtual_environment/bin/activate
pip
install
-r
src/python/requirements.txt
CFLAGS
=
-I
$root
/include
LDFLAGS
=
-L
$root
/libs/
$CONFIG
pip
install
src/python/src
CFLAGS
=
"
-I
$root
/include
-std=c89"
LDFLAGS
=
-L
$root
/libs/
$CONFIG
pip
install
src/python/src
pip
install
src/python/interop
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