Skip to content

Commit 61b0943

Browse files
committed
fix compile on ubuntu 20.04
1 parent 31fceca commit 61b0943

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gear-lib/libposix/test_libposix.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <stdio.h>
2424
#include <stdlib.h>
2525
#ifdef OS_LINUX
26+
#define __STDC_FORMAT_MACROS
27+
#include <inttypes.h>
2628
#include <unistd.h>
2729
#include <pthread.h>
2830
#include <sys/types.h>
@@ -45,7 +47,7 @@ void foo()
4547
if (0 > stat(file, &st)) {
4648
printf("stat %s failed\n", file);
4749
}
48-
printf("%s size=%zu\n", file, (uint32_t)st.st_size);
50+
printf("%s size=%" PRIu32 "\n", file, (uint32_t)st.st_size);
4951
get_proc_name(proc, sizeof(proc));
5052
printf("proc name = %s\n", proc);
5153

0 commit comments

Comments
 (0)