diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-11 13:16:20 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-11 13:16:20 +0300 |
commit | b9f14bddf778a5ed27e3289b90a0657fec3e1a53 (patch) | |
tree | 972d67e547f1816d3dbe0643ea8add734ef8e90e /tests/basic_stream/encode_stream.c | |
parent | e2e9980627810fe0ee2b8f119bcf651f0f318a8a (diff) |
Make all the tests ANSI C compatible.
Diffstat (limited to 'tests/basic_stream/encode_stream.c')
-rw-r--r-- | tests/basic_stream/encode_stream.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/basic_stream/encode_stream.c b/tests/basic_stream/encode_stream.c index fd25c6cb..7f571c41 100644 --- a/tests/basic_stream/encode_stream.c +++ b/tests/basic_stream/encode_stream.c @@ -4,6 +4,7 @@ #include <stdio.h> #include <pb_encode.h> #include "person.pb.h" +#include "test_helpers.h" /* This binds the pb_ostream_t into the stdout stream */ bool streamcallback(pb_ostream_t *stream, const uint8_t *buf, size_t count) @@ -22,7 +23,9 @@ int main() }}; /* Prepare the stream, output goes directly to stdout */ - pb_ostream_t stream = {&streamcallback, stdout, SIZE_MAX, 0}; + pb_ostream_t stream = {&streamcallback, NULL, SIZE_MAX, 0}; + stream.state = stdout; + SET_BINARY_MODE(stdout); /* Now encode it and check if we succeeded. */ if (pb_encode(&stream, Person_fields, &person)) |