Skip to contentSkip to conversation

cobalt: Fix uclibc build

PATCH New Jan Kiszka 1 participant 1 message Dec 12, 2019

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 cobalt: Fix uclibc build

From: Jan Kiszka <[email protected]>

Add missing forward declaration of timex, avoid incorrect alias creations by COBALT_IMPL due to wrongly defined fputc and putchar.

---
 include/cobalt/stdio.h | 4 ++--
 include/cobalt/time.h  | 2 ++
 lib/cobalt/printf.c    | 2 --
 3 files changed, 4 insertions(+), 4 deletions(-)
include/cobalt/stdio.h +2 -2
index 7108ffbc1d..5b9df80069 100644
@@ -73,7 +73,7 @@ static inline int __real_putchar(int c)
 int __wrap_putchar(int c);
 int __cobalt_putchar(int c);
 #undef putchar
-#define putchar __wrap_putchar
+#define putchar putchar
 #endif
 
 #ifndef fputc
@@ -86,7 +86,7 @@ static inline int __real_fputc(int c, FILE *stream)
 int __wrap_fputc(int c, FILE *stream);
 int __cobalt_fputc(int c, FILE *stream);
 #undef fputc
-#define fputc __wrap_fputc
+#define fputc fputc
 #endif
 
 COBALT_DECL(size_t,
include/cobalt/time.h +2 -0
index 9bafe341f7..e3f355c611 100644
@@ -30,6 +30,8 @@
 extern "C" {
 #endif
 
+struct timex;
+
 COBALT_DECL(int, clock_getres(clockid_t clock_id,
 			      struct timespec *tp));
 
lib/cobalt/printf.c +0 -2
index 261eccbab8..8982ddc937 100644
@@ -793,7 +793,6 @@ COBALT_IMPL(int, puts, (const char *s))
 	}
 }
 
-#undef fputc
 COBALT_IMPL(int, fputc, (int c, FILE *stream))
 {
 	if (!cobalt_is_relaxed())
@@ -804,7 +803,6 @@ COBALT_IMPL(int, fputc, (int c, FILE *stream))
 	}
 }
 
-#undef putchar
 COBALT_IMPL(int, putchar, (int c))
 {
 	if (!cobalt_is_relaxed())
Signature · 6 lines
2.16.4


-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux