mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-14 06:55:50 +02:00
Do not interleave code and declarations in C files
Avoid C99 style to interleave code and declarations in order to compile msgpackc with Visual Studion < 2013
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
#include <msgpack.h>
|
||||
#include <assert.h>
|
||||
|
||||
void test()
|
||||
{
|
||||
size_t size = 10000000;
|
||||
msgpack_sbuffer buf;
|
||||
msgpack_packer * pk;
|
||||
size_t upk_pos = 0;
|
||||
msgpack_unpacked msg;
|
||||
|
||||
msgpack_sbuffer_init(&buf);
|
||||
|
||||
msgpack_packer * pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);
|
||||
pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);
|
||||
|
||||
msgpack_pack_array(pk, size);
|
||||
{
|
||||
@@ -17,9 +20,6 @@ void test()
|
||||
}
|
||||
msgpack_packer_free(pk);
|
||||
|
||||
|
||||
size_t upk_pos = 0;
|
||||
msgpack_unpacked msg;
|
||||
msgpack_unpacked_init(&msg);
|
||||
|
||||
while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos)) {
|
||||
|
Reference in New Issue
Block a user