mirror of
https://github.com/fumiama/simple-protobuf.git
synced 2026-06-22 19:40:38 +08:00
修正include
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "simple_protobuf.h"
|
#include "simple_protobuf.h"
|
||||||
|
|
||||||
static uint32_t read_num(FILE* fp) {
|
static uint32_t read_num(FILE* fp) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef _SIMPLE_PROTOBUF_H_
|
#ifndef _SIMPLE_PROTOBUF_H_
|
||||||
#define _SIMPLE_PROTOBUF_H_
|
#define _SIMPLE_PROTOBUF_H_
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
struct SIMPLE_PB {
|
struct SIMPLE_PB {
|
||||||
|
|||||||
2
test.c
2
test.c
@@ -33,7 +33,7 @@ int main() {
|
|||||||
if(fp) {
|
if(fp) {
|
||||||
SIMPLE_PB* spb = get_pb(fp);
|
SIMPLE_PB* spb = get_pb(fp);
|
||||||
memcpy(&t, spb->target, sizeof(struct TEST));
|
memcpy(&t, spb->target, sizeof(struct TEST));
|
||||||
printf("a:%u\nb:%u\nc:%u\nd:%llu\ne:%s\n", t.a, t.b, t.c, t.d, t.e);
|
printf("a:%u\nb:%u\nc:%u\nd:%lu\ne:%s\n", t.a, t.b, t.c, t.d, t.e);
|
||||||
printf("Struct size: %u, read: %u\n", spb->struct_len, spb->real_len);
|
printf("Struct size: %u, read: %u\n", spb->struct_len, spb->real_len);
|
||||||
} else perror("[SPB]");
|
} else perror("[SPB]");
|
||||||
} else perror("[SPB]");
|
} else perror("[SPB]");
|
||||||
|
|||||||
Reference in New Issue
Block a user