• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 4970d00fecf52a472a28d55243f87142d3d08268 Mon Sep 17 00:00:00 2001
2From: jiangheng <jiangheng12@huawei.com>
3Date: Tue, 4 Jan 2022 17:23:03 +0800
4Subject: [PATCH] fix some compile errors
5
6---
7 src/include/arch/cc.h   | 4 ++--
8 src/include/lwiplog.h   | 2 +-
9 src/include/posix_api.h | 2 +-
10 3 files changed, 4 insertions(+), 4 deletions(-)
11
12diff --git a/src/include/arch/cc.h b/src/include/arch/cc.h
13index 33c24b4..222b0c9 100644
14--- a/src/include/arch/cc.h
15+++ b/src/include/arch/cc.h
16@@ -62,7 +62,7 @@ void alloc_memp_##name##_base(void) \
17     memp_pools[MEMP_##name] = &memp_ ## name; \
18     \
19     char mpname[MEMZONE_NAMESIZE] = {0}; \
20-    snprintf(mpname, MEMZONE_NAMESIZE, "%ld_%s", gettid(), #name); \
21+    snprintf(mpname, MEMZONE_NAMESIZE, "%d_%s", gettid(), #name); \
22     memp_memory_##name##_base = \
23         sys_hugepage_malloc(mpname, LWIP_MEM_ALIGN_BUFFER(__size)); \
24     memp_pools[MEMP_##name]->base = memp_memory_##name##_base; \
25@@ -73,7 +73,7 @@ PER_THREAD uint8_t *variable_name; \
26 void alloc_memory_##variable_name(void) \
27 { \
28     char mpname[MEMZONE_NAMESIZE] = {0}; \
29-    snprintf(mpname, MEMZONE_NAMESIZE, "%ld_%s", gettid(), #variable_name); \
30+    snprintf(mpname, MEMZONE_NAMESIZE, "%d_%s", gettid(), #variable_name); \
31     (variable_name) = \
32         sys_hugepage_malloc(mpname, LWIP_MEM_ALIGN_BUFFER(size)); \
33 }
34diff --git a/src/include/lwiplog.h b/src/include/lwiplog.h
35index 363e516..6fccac8 100644
36--- a/src/include/lwiplog.h
37+++ b/src/include/lwiplog.h
38@@ -40,7 +40,7 @@
39
40 #include "lwipopts.h"
41
42-#define gettid()    syscall(__NR_gettid)
43+extern int gettid(void);
44
45 #if USE_DPDK_LOG
46
47diff --git a/src/include/posix_api.h b/src/include/posix_api.h
48index 8aa8516..0dca8eb 100644
49--- a/src/include/posix_api.h
50+++ b/src/include/posix_api.h
51@@ -79,7 +79,7 @@ typedef struct {
52     int is_chld;
53 } posix_api_t;
54
55-posix_api_t *posix_api;
56+extern posix_api_t *posix_api;
57
58 int posix_api_init(void);
59 void posix_api_free(void);
60--
611.8.3.1
62
63